I got into a debate at work today, I hope you can help me to settle it up.
My colleague wants to separate UI, Model, DB, and Network like so:
Create an API level between UI and controller, that will allow the UI to query all the models in the APP.
There will be another controller that will break the models into their DB representations (Ex: UserTablesModel, ScoreTableModel...), It will be a singleton called DBControler and it will also provide some utility methods to query the DB (Ex: insert(tableName, value...).
The ModelTables will use events hub to notify UI with state changes, and they will be updated from the network layer using DBControler reference.
I don't like this idea as it creates a coupling between unrelated models in the controller layer. I think it would be wiser to allow the UI to have direct access to Models (maybe make them singletons) and it's up to the model to offer a proper API to access its data and provide an events callback to notify his state change (no events hub). I like the part that models need to be directly updated from the network layer.
Also I don't like the name TableModel, I think the DB needs to be a service accessible by the model, one model can access multiple tables.
What is the proper way to work with MVC?