in reply to OOP: Plugin Style Development
package Display::Base; sub new sub foo sub bar ---- package Display::LDAP; @ISA = qw(Display::Base); sub new sub foo sub bar ---- package Display::DBI; @ISA = qw(Display::DBI); sub new sub foo sub bar ---- etc...
If you're wondering if the language will enforce anything OOP ... the short answer is "No". It enables OOP, but doesn't enforce it like C++, Java, and/or Smalltalk. Perl isn't an inherently OOP language.
The plug-in architecture you're describing is essentially an overloaded base class. A few caveats:
This is best facilitated by passing hashrefs or objects around. Don't use fixed-size param lists.
Most importantly, if you come up with a really neat implementation, post it to CPAN.
------
We are the carpenters and bricklayers of the Information Age.
Don't go borrowing trouble. For programmers, this means Worry only about what you need to implement.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: OOP: Plugin Style Development
by jk2addict (Chaplain) on Jul 22, 2002 at 19:32 UTC | |
by dragonchild (Archbishop) on Jul 22, 2002 at 19:58 UTC | |
by jk2addict (Chaplain) on Jul 22, 2002 at 20:27 UTC | |
by dragonchild (Archbishop) on Jul 22, 2002 at 20:30 UTC |