in reply to OO-style question
If you have a method that seems correct for both A and B, could it be in the base class? Maybe you need a third level, ie a base class, from which C,D, and E inherit, and then A and B could inherit from C. C could even be an abstract class.
I disagree with Tye about Perl's inheritence. The big win in OO is inheritence, that and methods, so if you are going OO - go OO! The problem in Perl is that it is a bit kludgy when it comes to OO. Honestly, the more I work with Perl OO the more I think that a large OO project should be done in C++. It can be done in Perl (what can't be done in Perl?) but I'm not sure that it should be done in Perl. That is, large projects. Perl OO is great for smaller projects, even ones that use inheritence.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re:: Adam:: Re:: OO-style question
by coreolyn (Parson) on Dec 30, 2000 at 03:13 UTC | |
by merlyn (Sage) on Dec 30, 2000 at 09:03 UTC | |
by coreolyn (Parson) on Dec 30, 2000 at 19:45 UTC | |
by Fastolfe (Vicar) on Dec 30, 2000 at 19:53 UTC | |
by coreolyn (Parson) on Dec 30, 2000 at 20:02 UTC | |
| |
by Adam (Vicar) on Dec 31, 2000 at 07:42 UTC | |
by tilly (Archbishop) on Dec 31, 2000 at 08:45 UTC | |
by mkmcconn (Chaplain) on Jan 01, 2001 at 02:43 UTC | |
by btrott (Parson) on Dec 31, 2000 at 08:04 UTC | |
by tye (Sage) on Dec 31, 2000 at 11:01 UTC |
In Section
Seekers of Perl Wisdom