Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
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 cooling their heels in the Monastery: (8)
As of 2015-07-04 13:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (60 votes), past polls