Association, Aggregation, Composition


Association, Aggregation, Composition
When we have only one relationship between objects that may be Association. Aggregation and Composition.
           
In details
           
Association:
            This is relation where each object has it own life cycle , independent  and no owner.
Ex:-
            Will take a common example of project and developer
            A project will be having multiple developers and developer can work for different projects. There is a relationship but both are independent. Both can create and delete independently.

 Aggregation:
This is a specialize form of Association where all object have their own lifecycle has ownership on child object and the child object cannot belongs be related to another parent object.

Ex:-
            Will take an example of Departments and developers
            A developer can be only in one department like dotnet, java etc., but if we delete the Department object still the Developer object exists. This is a “Has- a” relation.        

 Composition:
This is specialize form of Aggregation and can be called as strong Aggregations
Where the child object has no life if the parent object is deleted, because of this we call this as “death” relationship.

Ex:-    
            Best example is House and room
            A house can have multiple rooms but if we delete the house the child i.e. rooms will also be deleted and has no life.

Comments

Popular posts from this blog

Maximize child MDI form without ControlBox

Adding text to label using javascript

Get Text Height & Width