Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Strategy Handles

by ruoso (Curate)
on Jan 05, 2006 at 14:04 UTC ( #521209=note: print w/ replies, xml ) Need Help??


in reply to Strategy Handles

Mentioning Design Patterns, The pattern I use for this type of problem is "Class Factory". Using this pattern you won't need that each implementation are subclasses or not of the Interface (Well, actually you have several classes that implements the same interface).

The class factory could, for instance, check a configuration file, the time of the day and the phase of the moon to decide which implementation to use and this would be hidden from the code that uses it.

daniel


Comment on Re: Strategy Handles

Log In?
Username:
Password:

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

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

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (165 votes), past polls