What does the MVW of Angularjs mean?

Asked

Viewed 2,408 times

8

When Google searches for Angular, it is returned:

Angularjs - Superheroic Javascript MVW Framework

  • I know that MVC means Model-View-Controller but what is the W of MVW Framework?
  • Is this a new standard software architecture? A new Pattern design?
  • As it differs from "traditional" MVC, MVVM, MVP?
  • 3

    Whatever .

  • 3

    Sérião. I’m just not going to answer the question because eventually Onosendai will appear here and give a good answer. If he doesn’t appear I’ll write something.

  • 3

    It really means Whatever https://plus.google.com/+AngularJS/posts/aZNVhj355G2 but I’m waiting for a good answer from Onosendai

  • @jbueno You can answer, I am in meeting all day

  • 1

    In fact it is that same rs, including this has already been answered in Stack Overflow English, referencing the same link passed by Jeferson. I would answer, but I think it would be disrespectful to @jbueno who commented first.

1 answer

13


I warn you that this is a controversial topic that many developers can spend hours and hours debating and discussing, but I will try synthesize a little bit of information.


MVW - Model View Whatever

The MVW standard is not actually a standard, MVW, meaning Model-View-Whatever, IE, whatever standard you think will program in Angularjs, do not waste time, just do. Simply what works for you.

For several years, Angularjs was closer to MVC (or rather one of the client-side variants), but over time and thanks to many refactoring and API improvements, it is closer to MVVM - the object of $ Scope can be considered the View-Model that is being decorated by a function that is called Controller.

Representação do MVW

Differences between the Patterns design

**The MVW standard is not really a standard, MVW means Model-View-Whatever, I mean, whatever, don’t waste time and keep arguing about these absurd things MV*, just do.

MVC

  • Model-View-Controller (MVC) is an architectural standard used in software engineering in which the standard isolates "domain logic" (application-to-user logic) from the user interface (input and presentation), allowing independent development, testing and maintenance of each (separation of concerns).

MVP

  • Model-view-presenter (MVP) is a derivative of the software standard model-view-controller, mainly used to build user interfaces. In MVP, the presenter assumes the functionality of the "Middle-man" (corresponding to the application controller in MVC). In addition, the view is responsible for handling UI events (such as mouse down, key down, etc.), which used to be the work of controller. Eventually, the model becomes strictly a domain model.

MVVM

  • Model-View-Viewmodel (MVVM) is an architectural design standard for user interface implementation. Its main focus is the separation of concern between the View (UI) and the Model (Data) using an intermediate layer called Viewmodel to improve manageability, scalability and testability.

Code Comparison

GIFTED

<input type='text' id='bind-input'>
<label id='bind-output'></label>

And Javascript:

window.addEventListener('load', function() {
  var input = document.getElement('bind-input'),
      output = document.getElement('bind-output');

  input.addEventListener('change', function() {
    output.innerText = input.value;
  });
});

We have to explain very specifically what we need the browser to do. We have to use the Listener of certain events, make sure that the DOM is loaded, track the ID’s of our element, all to update the label every time the input changes.

With jQuery

<input type='text' id='bind-input'>
<label id='bind-output'></label>

And we still need Javascript:

$(document).ready(function() {
  var $input = $('#bind-input'),
      $output = $('#bind-output');

  $input.on('change', function() {
    $output.html($input.value());
  });
});

As you can see, this is quite similar to the DOM approach. We need to explain to the browser exactly what we want to do.

Angular

<input type='text' ng-model='bound'>
<label ng-bind='bound'></label>

Nor do we need to write any code for this to work with Angular. (Obviously, we need a controller empty somewhere, but you can understand the idea).

The declarative approach is primarily a way to abstract the implementation details. Angular guidelines make it very easy to complete these common behaviors into small reusable components than can be applied to our HTML in a declarative form.

Completion

Angularjs gives a lot of flexibility to separate the logic of presentation from the logic of business and the state of presentation. All these denominations actually only separate the logical part from the visual part, no matter what it is. Angularjs makes this very explicit when you create a controller where the data will be processed and HTML with the directives where the data will be exposed.

Related

I think I’ve got an idea =)

Browser other questions tagged

You are not signed in. Login or sign up in order to post.