Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Designing multiple related modules

by rje (Deacon)
on May 13, 2021 at 20:25 UTC ( #11132552=note: print w/replies, xml ) Need Help??


in reply to Designing multiple related modules

"1 - Three separate modules."

"Simply write three modules with similar names as in the code above. Each module has methods with the same names and similar new method. All social media platforms use OAuth2 so new can be largely the same."

I did just this in a personal project. I didn't want classes, because the only thing they have in common is the API -- I'd use interfaces but as long as each package supplies the required methods it works fine.

Common code is either retained in the main program, or else stashed in a utility package ("component") that everyone uses.

A factory is the nicest way to do this I think. Depending.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (5)
As of 2023-12-11 11:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What's your preferred 'use VERSION' for new CPAN modules in 2023?











    Results (41 votes). Check out past polls.

    Notices?