Perl Monk, Perl Meditation | |
PerlMonks |
Re: Inheritance based on inputby Fletch (Bishop) |
on Oct 06, 2010 at 19:32 UTC ( [id://863859]=note: print w/replies, xml ) | Need Help?? |
Sounds like you're looking for something along the lines of the Adapter pattern (and/or the Facade pattern). Your DeviceClass would be a factory which returns instances of DeviceAdapter::Device1 or what not; DeviceAdapter::Foo would convert from your generic interface into the correct calls on a Foo instance, DeviceAdapter::Bar similar for Bar instances.
The cake is a lie.
In Section
Seekers of Perl Wisdom
|
|