Thread: difference between aggregation and composition

  1. #1
    Registered User
    Join Date
    Oct 2004
    Posts
    7

    difference between aggregation and composition

    hi everybody,

    what's the difference between aggregation and composition in object oriented programming?

    please explain the difference between these two with an example or
    suggest any link where i can get information about these topics?

  2. #2
    Registered User hk_mp5kpdw's Avatar
    Join Date
    Jan 2002
    Location
    Northern Virginia/Washington DC Metropolitan Area
    Posts
    3,817
    They are the same thing. Some objects are composed of (a composition) or an aggregate of (an aggregation) numerous other objects. As an example, take a car object, it can be composed of tire objects, engine objects, etc.
    Last edited by hk_mp5kpdw; 10-18-2004 at 12:20 PM.
    "Owners of dogs will have noticed that, if you provide them with food and water and shelter and affection, they will think you are god. Whereas owners of cats are compelled to realize that, if you provide them with food and water and shelter and affection, they draw the conclusion that they are gods."
    -Christopher Hitchens

Popular pages Recent additions subscribe to a feed