Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is data binding fundamentally incompatible with MVC?

Data binding establishes a direct coupling between the view and the model, thereby bypassing the controller. Fundamentally this breaks with the Model-View Controller architectural pattern, am I right in thinking this? Does this make data binding a "bad thing"?

Edit: As example, angular claims to be a MVC framework, yet one of its main features is data binding.

like image 368
Zef Hemel Avatar asked Mar 21 '11 09:03

Zef Hemel


People also ask

What is data binding in MVC?

ASP.NET MVC model binding allows mapping HTTP request data with a model. It is the procedure of creating . NET objects using the data sent by the browser in an HTTP request. Model binding is a well-designed bridge between the HTTP request and the C# action methods.

What were the major problems with MVC framework?

Major drawbacks of MVC in react js include manipulation of DOM which is very expensive and also at the cost of time and memory wastage. For implementing MVC, knowledge of multiple languages and technologies is required which requires enormous manpower having different expertise.

How does data binding in AngularJS relate to the MVC architecture?

It facilitates to write the client side application in an MVC architecture. Data Binding is one of the key features of AngularJS, as it is the automatic synchronization of data between the model and view components.

Is MVC architecture outdated?

The MVC pattern is certainly not obsolete. It is at the core of many popular web development frameworks that are widely used today. It's also part of a lot of actively running solutions that won't be replaced anytime soon.


1 Answers

In my opinion Data Binding can be a valid implementation of the MVC Pattern since the data binding mechanism itself acts as the controller in that case.

For example in the mentioned angular it seems like the $watch function is a shortcut to implement features that are typical Controller responsibilities and features in an MVC-style way.

So in my opinion data binding is an evolution step that implements best practices learned by implementing classic MVC controllers.

UPDATE

But in original pattern sense I would characterize data binding more like MVP or Passive View.

But the differences aren't that sharp in my opinion since it always also depends on your UI technology.

like image 67
Johannes Wachter Avatar answered Oct 31 '22 18:10

Johannes Wachter