model view controller - MVC vs. Flux ? Bidirectional vs. Unidirectional? -
looking @ following diagram (which explains mvc), see unidirectional data flow.
so why consider mvc have bidirectional data flow while justifying flux ?
because in javascript frameworks mvc not work way depicted. ui communicates bi-directionally model, in:
- user types view input
- mvc framework binds onchange() update model.
- ajax request brings in new model data.
- mvc framework updates view input's value match model.
in flux architecture, ui fire independent action type , associated data dispatcher update model same way background ajax method update model.
reference: http://www.thesoftwaresimpleton.com/blog/2013/03/23/client-side-mvc/
"client side mvc different server side mvc"
"we setting 2 way communication between 2 objects..."
"in short wiring value of firstname property of person object value property of input."
http://guides.emberjs.com/v1.10.0/object-model/bindings/
bindings in ember.js can used object, not between views , models.
Comments
Post a Comment