jeudi 3 décembre 2015

MVVM "binder" definition and its usage?

I've been looking around on internet to get a better understanding of MVVM in general.

On Wikipedia it states the components of the MVVM pattern are:

  • Model
  • View
  • View Model
  • Binder

This is the first time I encountered the binder definition along with the model, view, view-model that are part of the acronym.

The Wikipedia definition of the MVVM 's "Binder" states the following:

Declarative data- and command-binding are implicit in the MVVM pattern. In the Microsoft solution stack, the binder is a markup language called XAML. The binder frees the developer from being obliged to write boiler-plate logic to synchronize the view model and view. When implemented outside of the Microsoft stack the presence of a declarative databinding technology is a key enabler of the pattern.

Question: Does every MVVM pattern always include a binder? What is the binder exactly used for? Is it something that you actually code or is there just some automation going on with the framework?

I work and use AngularJS almost every day, and some agree that its pattern is MVVM as opposed to MVC/MVP. I got that the View Model it's what AngularJS calls "Controller", as a reminiscence of "classical" MVC. But does AngularJS use a binder too? I still haven't seen anything like that while coding in AngularJS, maybe the binder is just used on a desktop programming framework rather than on browsers?

On Wikipedia it gives WPF's XAMl as a C# example of binder, so what would be the counter-example on AngularJS? The AngularJS's templates and/or their syntax are the view and/or binder too?

Could you provide a better explanation of the Wikipedia's article, maybe with a couple of examples (AngularJS and/or WPF)?

EDIT: I've looked more on SO and found a like to these slides which introduce the term MVB rather than MVVM, so: is this binder we're talking about an optional, and does it appear in both MVVM and MVB?

Does the binder just refer to the data-binding going on between the View and the View-Model? How would you represent the binder on a chart? Is it just like the "Data-Binding" on this one?

Thank you.

Aucun commentaire:

Enregistrer un commentaire