What is association. how it is differ from composition and aggregation?

Posted by Raja123 under Interview Questions on 9/6/2010 | Points: 10 | Views : 2133 | Status : [Member] | Replies : 1
Can you give some clear information regarding aggregation.. where we use it. and give with some realtime scenario.Please it will helpful for me and other visitor also.


Posted by: Kishork80 on: 9/6/2010 [Member] Starter | Points: 25

Association ,Compostion and Aggregation are one of teh pillars of OOPs
Composition:when twoobjects have same life-time (Person+heart/Customer+address) without one there is no existance of other
Aggregation:when 2 objects have different-life time(Person+shirt+pant/Customer+logging)
Association: is a relationship between two classes, where one class use another.

kishor kumar

Raja123, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response