O'Reilly logo

Mastering JavaScript Design Patterns by Simon Timms

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Model View ViewModel

The final pattern we'll look at in this chapter is the Model View ViewModel pattern, more commonly known as MVVM. By now, this sort of pattern should be getting quite familiar. The following diagram explains the MVVM pattern:

Model View ViewModel

You can see here that many of the same constructs have returned, but that the communication between them is somewhat different.

In this variation, what has previously been the controller and presenter is now the view model. Just like with MVC and MVP, the majority of the logic is held within the central component, in this case, the view model. The model itself is actually very simple in MVVM. Typically, it ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required