in reply to Designing multiple related modules
I am in favour of (2) creating an "interface" although I would call it "base class" because it will have common functionality implemented in there, centrally and for once. For example a toString() method or export/import_session() which would not be in general needed to be overwritten by subclasses.
An advantage of this is that 3rd party developers can contribute implementation classes for different social media while the API is centrally controlled. Provided that there is indeed a common API with these and future social media sites (hmm not so sure about that).
An example for the above is HTTP::Cookies and the large number of subclasses (by different contributors) overwriting its load() and save() methods for various browsers and cookie standards. The key point is: contributions by 3rd party. And the biggest problem is for you to identify the API and make sure it will be generic and can survive in time, respecting the contributions by others.
PS. I may be missing something but (4) Factory works in conjuction with (2), not as an alternative.
bw, bliako
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Designing multiple related modules
by Fletch (Bishop) on May 12, 2021 at 13:59 UTC | |
by bliako (Abbot) on May 13, 2021 at 17:58 UTC | |
by Fletch (Bishop) on May 13, 2021 at 19:50 UTC | |
|
Re^2: Designing multiple related modules
by Bod (Parson) on May 12, 2021 at 16:34 UTC | |
by bliako (Abbot) on May 13, 2021 at 18:29 UTC | |
by Bod (Parson) on May 15, 2021 at 20:13 UTC |