Arian Hosseinzadeh Arian Hosseinzadeh - 1 year ago 228
React JSX Question

MVC vs. Flux ? Bidirectional vs. Unidirectional?

Looking at the following diagram (which explains MVC), I see unidirectional data flow.

So why do we consider MVC to have bidirectional data flow while justifying Flux ?

MVC Pattern

Answer Source

Because in Javascript frameworks the MVC does not work the way you depicted. The UI generally communicates bi-directionally with the model, as in:

  1. User types into View input
  2. MVC framework binds onchange() to update a model.
  3. Ajax request brings in new model data.
  4. MVC framework updates View input's value to match model.

In Flux architecture, the UI would only fire an independent action with type and associated data to a dispatcher which would then update the model the same way any background ajax method would update the model.


"Client Side MVC is completely different than Server Side MVC"

"We are setting up a two way communication between two objects..."

"In short we are wiring together the value of the firstName property of the Person object to the value property of the input."

bindings in Ember.js can be used with any object, not just between views and models.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download