Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Designing multiple related modules

by rje (Deacon)
on May 13, 2021 at 20:25 UTC ( [id://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 pondering the Monastery: (10)
As of 2024-05-21 22:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found