You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, we've implemented MVC or MV(C)VM, depending on a component. There's been ongoing discussion between us on which approach is better and we couldn't make a final decision, so the code isn't very consistent at the moment.
We need to verify which pattern better fit into our lib. So far we think that MV(C)VM will do best, however, we need to improve the initialisation of such components.
Currently, there's an issue with how view model can be created by a controller (and then passed to view), while controller should also be given its view in its constructor. This means initialisation like this:
This is obviously ugly. Fortunately, we seem to agree that since view model is very tightly bound to the view, it can be instantiated by that view, to be later retrieved and controlled by the controller:
constmodel=newModel();constview=newView();// it creates view.modelconstcontroller=newController(model,view);// controller reads view.model
The text was updated successfully, but these errors were encountered:
One of the things that would need to be standardized is where we keep docs for the model and view model interfaces. View models can be documented inside views I guess and model perhaps inside controllers.
Currently, we've implemented MVC or MV(C)VM, depending on a component. There's been ongoing discussion between us on which approach is better and we couldn't make a final decision, so the code isn't very consistent at the moment.
We need to verify which pattern better fit into our lib. So far we think that MV(C)VM will do best, however, we need to improve the initialisation of such components.
Currently, there's an issue with how view model can be created by a controller (and then passed to view), while controller should also be given its view in its constructor. This means initialisation like this:
This is obviously ugly. Fortunately, we seem to agree that since view model is very tightly bound to the view, it can be instantiated by that view, to be later retrieved and controlled by the controller:
The text was updated successfully, but these errors were encountered: