in reply to Composition Examples Sought
In C++ this takes place through protected or private inheritance, or making an object a member. Obviously just making it a normal member is the less idiomatic way. Using inheritance for that essentially exports the interface of the internal object to outside users of the class. You have to do that explicitly if you want it done at all, with normal membership composition.
In Perl, I guess this would be something like $self->{obj} = new ObjectBlah; Simple as that.
--
Ash OS durbatulk, ash OS gimbatul,
Ash OS thrakatulk, agh burzum-ishi krimpatul!
Uzg-Microsoft-ishi amal fauthut burguuli.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Composition
by darrel3edndcom (Novice) on May 24, 2002 at 01:47 UTC | |
by hagus (Monk) on May 24, 2002 at 01:58 UTC |