in reply to Re^5: Object Constructors - Advice of experienced OO Perl Monks
in thread Object Constructors - Advice of experienced OO Perl Monks
The point is that two steps initialization is error prone. You can avoid that using the Composite scheme: class A has B and C class instead of class A is B and C class.
Update: Extracted from perltoot:
In practice, few class modules have been seen that actually make use of MI. One nearly always chooses simple containership of one class within another over MI. That’s why our Person object contained a Fullname object. That doesn’t mean it was one.
Igor S. Lopes - izut
surrender to perl. your code, your rules.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^7: Object Constructors - Advice of experienced OO Perl Monks
by Perl Mouse (Chaplain) on Oct 06, 2005 at 16:46 UTC |
In Section
Seekers of Perl Wisdom