difference between aggregation and composition

This is a discussion on difference between aggregation and composition within the C Programming forums, part of the General Programming Boards category; hi everybody, what's the difference between aggregation and composition in object oriented programming? please explain the difference between these two ...

  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,799
    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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21