Sei sulla pagina 1di 5

3.

Fundamental Principles of Object-oriented Detailed Design

Encapsulation

Encapsulation is the act of combining properties and methods that related to the same
object.

Inheritance
Inheritance is the process of acquiring the properties of the base class into the sub class.
For example, Car is a sub class of FourWheeler class. Here Car acquires the properties of the
FourWheeler class. Other sub classes could be a Jeep, Tempo, Van etc.
Here is the second example

Polymorphism
It means one method with multiple implementations(act or instance), for a certain class of
action. For example, you are developing a calculator application, you will need to define
different functions for different arithmetic operations like addition, subtraction, multiplication,
division, etc. If you are defining a function for addition like.

Abstraction
The process of selecting important data sets for an Object in your software and leaving
out the insignificant ones.
Ex: banking application

4. Design Classes and the Design Class Diagram


Class diagrams are the main building block in object-oriented modeling. They are used to
show the different objects in a system, their attributes, their operations and the relationships
among them.
Design specifying the structure of how a software system will be written and function,
without actually writing the complete implementation. When we say Design Class it is the
description of a set of objects that share the same responsibilities, relationships, operations,
attributes, and semantics. When we say Design Class Diagram it helps to determine the static
relations between them. With detailed modelling the classes of the conceptual design are often
split into a number of subclasses.

Relationship in Class Diagram symbols:


Classes are interrelated to each other in specific ways. In particular, relationships in class
diagrams include different types of logical connections. The following are such types of logical
connections that are possible in UML:

• Association
• Municipality
• Aggregation
• Generalization
• Realization
• Association

An association represents a relationship between two classes:

• Multiplicity

A multiplicity allows for statements about the number of objects that are involved in an
association, For example, one fleet may include multiple airplanes, while one commercial
airplane may contain zero to many passengers. The notation 0..* in the diagram means “zero to
many”.

• Aggregation

Refers to the formation of a particular class as a result of one class being aggregated or
built as a collection. For example, the class “library” is made up of one or more books, among
other materials.
• Generalization

Generalization is a relationship between two classes: a general class and a special class, n
other words, the child class is a specific type of the parent class. To show inheritance in a UML
diagram, a solid line from the child class to the parent class is drawn using an unfilled
arrowhead.

• Realization

Denotes the implementation of the functionality defined in one class by another class. To
show the relationship in UML, a broken line with an unfilled solid arrowhead is drawn from the
class that defines the functionality of the class that implements the function. In the example, the
printing preferences that are set using the printer setup interface are being implemented by the
printer.

Potrebbero piacerti anche