![]() |
|
Syntactic Confectionery Delight | |
PerlMonks |
Re: Designing multiple related modulesby rje (Deacon) |
on May 13, 2021 at 20:25 UTC ( #11132552=note: print w/replies, xml ) | Need Help?? |
"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.
In Section
Seekers of Perl Wisdom
|
|