From: Itay Maman (itay_maman_at_[hidden])
Date: 2002-07-02 01:36:40
Joel de Guzman wrote:
> Itay Maman wrote
>> The Inheritance relationship is also a composition.
> ? care to explain ? I always thought that inheritance (*is-a*)
> is different from aggregation (*has-a*).
When you define D to inherit from B, then, B becomes a semi-data member
of D. The only difference is
that you need to use the "::" operator to access it (rather than the "."
We can say that inheritacne is a compostion + some additional properties
(primarily: polymorphism). As explained by Sutter, These additional
properties incur increased coupling which is a negative side-effect of
struct D1 : B
cout << B::x_;
cout << b_.x_;
Boost list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk