I am starting a project based on multiple webapplications (Website, ControlPanel, RestAPI) each based on the same Data[bases] and an MVC framework.
To avoid parallel code maintenance I thought of having the same model-files for each app. But when thinking deeper all possible approaches have some pro's and con's. I thought I'd ask some experts.
Possible ways to go (I know of) :
1. Plugin ~one4all
The very core of logic encapsuled as a plugin which is deployed in each app.
++ Only one model per table for all apps
-- One bug can crash 4 apps
-- lots of unused code per app
2. Duplicated code ~all4one
Double maintenance of duplicated model files.
++ Bugs affect only one app
++ Models does not contain unused code
-- Inefficient development
3. Api between apps ~lonewolves
Apps get its data from an api.
++ one code serves all apps
-- uncommon approach
-- massive overhead
4. Models symlinked ~lazy1
One application holds the model files, the other apps will symlink/include it.
++ almost no extra work to do
+- seems hilarious
-- one bug affects all apps
-- could restrict debugging
Are there more possible approaches? Which one is common/recommended? I don't want to combine the functionality of all apps into one to avoid crashing the whole thing with one pull.
More approaches and ideas are very welcome. Thank you in advance.