mardi 1 avril 2014

I find Controller to be too complex and tightly coupled with View

In current usage of controllers it seams that it is not possible to simply replace View since Controller is referencing specific View components and events through both refs and eventHandlers. Should'nt View and Controller communicate through predefined set of commands without any knowledge of inner works of the other. So View would send commands like: getListOfUsers, storeUser and Controller would send commands like showLogiScreen, ShowError without referencing specific View components.



Also wouldn't be much more simpler if Controller didn't have properties refs and control but just handler functions with the same name as events that can be triggered by the View?



I am just saying that I have a feeling that View and Controller could be more decoupled and that Controller could be made much simpler by simply waiting for events rather then referencing specific View components and events.




Aucun commentaire:

Enregistrer un commentaire