Click here to Skip to main content
15,891,529 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
where to use Containment and Inheritance
Posted

Inheritance: Exposes the managed object as the outer object
Containment: Enables the outer object to modify the behavior of the inner object.

Here have a look at how both are used differently in the following scenario: MSDN: COM reusability in the .NET Framework[^]
 
Share this answer
 
Comments
sravani.v 11-May-12 2:30am    
Good Reference
My 5!
Sandeep Mewara 12-May-12 5:45am    
Thanks Sravani.
 
Share this answer
 
Comments
shriti 3 11-May-12 2:32am    
Not able to differentiate which one is better to use EIther Containment or Inheritance
shriti 3 11-May-12 6:44am    
We Should follow containment process or should go for Inheritance .Please Suggest
Sandeep Mewara 12-May-12 5:47am    
Use whatever feels right in the situation. Mostly Inheritance.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900