Hi All,
I am trying to get the exact defintion with examples for the Object relationships.
In OOPs all the Objects need to communicate with each other otherwise as said standing alone does not help, its a team game
I have 3 type of relations with me.I have found some disagreement on this.
Some people i have encountered they say Aggregation and Composition are special type of Association.Whereas other sphere of Intellegentsia go for the three are different.
I am somehow convinced by the later one.
Association:- When an Class A has connection to Class B by just having a reference to Class B.Where Class A's behaviour is not to create an Object of B type.That is assocaiton where it just associates with B.
Aggregatation:- In this case Class A has a behaviour (method) which created an instance of Class B i.e. Class A aggregates Class B.
Composition:- This relationship is when Class A fully controls the lifecycle of Class B. i.e. Class A creates Class B and Destroys Class B as its behaviour.
I would love to hear thoughts of experts here on this topic.
Saurav