Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Best practice for a module which can use one of multiple image modules

by Anonymous Monk
on Aug 19, 2019 at 17:35 UTC ( #11104697=note: print w/replies, xml ) Need Help??


in reply to Best practice for a module which can use one of multiple image modules

(In any programming language ...) This is a great place to use classes. The image-handling operations are defined by what (in other languages) would be called an "abstract parent-class" which defines how the rest of the application sees it. Then, for each actual implementation, you have a "concrete" child class that inherits from the parent and implements all of its methods.

It is also common practice to build a "factory" which, given various appropriate parameters to describe the input that is to be handled, automatically returns a child object of the appropriate concrete class. The rest of the application, therefore, doesn't have to care. It simply treats the returned object as though it were the abstract parent.

  • Comment on Re: Best practice for a module which can use one of multiple image modules

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (4)
As of 2019-11-18 22:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Strict and warnings: which comes first?



    Results (92 votes). Check out past polls.

    Notices?