Quantcast
Channel: Visual C# forum
Viewing all articles
Browse latest Browse all 31927

Composition Example C#

$
0
0

Hi,

I need to find pratical explaination of Composition in C#.

Composition is again specialize form of Aggregation. It is a strong type of Aggregation. Child object does not have their lifecycle and if parent object deletes all child objects will also be deleted.

Lets take an example, Houses and Room.

publicclassRoom{//...}publicclassHouse{Room r =newRoom();//...}

If we delete House class (Parent) how should child object destoy which Room

Pleased advice

Thanks

طحہ زبیر احمد Taha Zubair Ahmed http://www.tahazubair.blogspot.com


Viewing all articles
Browse latest Browse all 31927

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>