Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Inheritance based on input

by Fletch (Chancellor)
on Oct 06, 2010 at 19:32 UTC ( #863859=note: print w/replies, xml ) Need Help??


in reply to Inheritance based on input

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.
The cake is a lie.
The cake is a lie.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://863859]
help
Chatterbox?
[shmem]: ns{1,2,3}.nasa.gov unreachable and no caching. -.-
[karlgoethebier]: funny that they call it Big Dipper in the US. Here this part of Ursa Major is called "Großer Wagen" Big wagon...or car as you like ;-)
[stonecolddevin]: morning all

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (11)
As of 2017-11-21 18:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:













    Results (308 votes). Check out past polls.

    Notices?