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-type implementation enforces bidirectional data flows, which differs from the unidirectional data flow maintained in Flux and Redux. In MVC, there is no single direction in an application that data flows in.
Bidirectional and unidirectional dataflow refers to boundaries, domains, and direction data moves between services and views. Binding refers to a singular one-one-one relationship, while bidirection and unidirection refers to the relationship between components.
Unidirectional. There's a bi-directional data flow between View and Presenter in MVP. To set the data to the view, it usually calls view. setUser(user) and to update certain data, view would call presenter.
Real and Pure MVC is unidirectional. It is clear from the the wikipedia diagram pasted in the question.
More than a decade ago, when server side frameworks like Apache Struts implemented a variant of MVC called Model View Presenter (MVP) pattern, they made every request go through controller and every response come back through controller. Everyone continued calling it MVC. Due to inherent nature of the web, any changes in the model cannot be propagated to the view without view sending a request or update. So Pure MVC is not implemented. Rather MVP is implemented.
Few years back, when frameworks like Angular, Ember, Knockout implemented MVC on front end, they implemented another variant of MVC called Model View ViewModel (MVVM) pattern, few folks continued called it MVC. (and few realized that terminology is not important and called it MVW (W stands for Whatever)), none of them implemented pure MVC.
When React was born, they took the opportunity to implement pure MVC (not MVP or MVVM), and renamed it as Flux with few changes. I feel Flux is one more variant of MVC. Although, Flux/React team says it is not MVC, I see lot of parity between both the architectures - Flux and MVC.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With