Hi,
how do I implement aggregation and how composition in C# ?
When I say : an Airplane has a Pilot then I use aggregation but
when I say : an Airplane has a Cockpit then I use composition.
How do I implement the difference in C# ?
Here's what I try :
class Pilot
{....}
class Cockpit
{...}
class Airplane
{
Pilot p;
Cockpit c;
public Airplane()
{
p = new Pilot(); // must be aggregated
c = new Cockpit(); // must be composed
}
}
I don't see any difference. Is there a way to create the distinction ?
thanks
Chris
************************************************** ********************
Sent via Fuzzy Software @ http://www.fuzzysoftware.com/
Comprehensive, categorised, searchable collection of links to ASP & ASP.NET resources...