What is a good object oriented design?

By | May 16, 2014

Dependencies Dependencies are relations ships between two entities that that a change in specification of one thing may affect another thing

Generalization Generalization is relationships specified in the class subclass scenario, it is shown when one entity inherits from other

Association Aggregation is a type of association where there is a has a relation ship, That is a room has walls,if there are two classes room and walls then the relation ship is called a association and further defined as an aggregation.

Aggregation and Composition Both aggregation and composition are special kinds of associations.

Aggregation is used to represent ownership or a whole/part relationship, and

Composition is used to represent an even stronger form of ownership. With composition, we get coincident lifetime of part with the whole. The composite object has sole responsibility for the disposition of its parts in terms of creation and destruction. In implementation terms, the composite is responsible for memory allocation and deallocation Moreover, the multiplicity of the aggregate end may not exceed one; i.e., it is unshared. An object may be part of only one composite at a time. If the composite is destroyed, it must either destroy all its parts or else give responsibility for them to some other object. A composite object can be designed with the knowledge that no other object will destroy its parts. Composition can be used to model by-value aggregation, which is semantically equivalent to an attribute. In fact, composition was originally called aggregation-by-value in an earlier UML draft, with “normal” aggregation being thought of as aggregation-by-reference. The definitions have changed slightly, but the general ideas still apply. The distinction between aggregation and composition is more of a design concept and is not usually relevant during analysis.
A Design which complies with the Object Oriented Principles of abstraction, inheritance, encapsulation, and polymorphism. Also which is characterized by loose coupling and strong cohesion

A design using Interface for abstraction and Inheritance for Code reusability

Also Uses Principles such as Interface segregation and Open/closed principles.

Leave a Reply