C H A P T E R  3

Adding a View Model

If you have done any serious desktop or server-side development, you will have encountered either the Model-View-Controller (MVC) design pattern or its derivative Model-View-View-Model (MVVM). I am not going to describe either pattern in any detail, other than to say that the core concept in both is separating the data, operations, and presentation of an application into separate components.

There is a lot of benefit in applying the same basic principles to a web application. I am not going to get bogged down in the design patterns and terminology. Instead, I am going to focus on demonstrating the process for structuring a web app and explaining the benefits that are gained from doing so.

Resetting the Example ...

Get Pro JavaScript for Web Apps now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.