PDA

View Full Version : what is the difference between aggregation and


mubashir
07-20-2010, 03:15 AM
inheritance in c++; also which one is better?

Naresh
07-20-2010, 09:19 AM
Inheritance: extend the functionality of a class by creating a subclass. Override superclass members in the subclasses to provide new functionality. Make methods abstract/virtual to force subclasses to "fill-in-the-blanks" when the superclass wants a particular interface but is agnostic about its implementation.
Aggregation: create new functionality by taking other classes and combining them into a new class. Attach an common interface to this new class for interoperability with other code.


http://friendme.in/