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 ?

mvc pattern

because in javascript frameworks mvc not work way depicted. ui communicates bi-directionally model, in:

  1. user types view input
  2. mvc framework binds onchange() update model.
  3. ajax request brings in new model data.
  4. 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

Popular posts from this blog

java - Static nested class instance -

c# - Bluetooth LE CanUpdate Characteristic property -

JavaScript - Replace variable from string in all occurrences -