Beefy Boxes and Bandwidth Generously Provided by pair Networks DiBona
Your skill will accomplish
what the force of many cannot
 
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.


Comment on Re: Inheritance based on input
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://863859]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (15)
As of 2014-04-18 14:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (469 votes), past polls