Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
C# Newbie Question..
Message
 
To
16/03/2003 16:57:28
Alvin Lourdes
Children and Youth Services Cluster
Toronto, Ontario, Canada
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
00766381
Message ID:
00766526
Views:
22
Both, aggregation and composition are parent/child relationships. The difference is that in composition, the parent controls the life time (creation/destruction) of the object.

An example of composition is when you drop a control inside a form. The form will take care of creating/destroying the object.

Take a look at: http://ootips.org/uml-hasa.html


>Hi,
>
>I understand how Inheritance can be used in C#. I am also able to understand how Inheritance is coded in C#.
>
>However, Composition/Aggregation and how they can be interpreted in code eludes me.
>
>Could someone explain how I would use composition/aggregation in code.
>
>Thank You,
>
>Alvin
Hector Correa
Previous
Reply
Map
View

Click here to load this message in the networking platform