Tips and tricks

The different layers of the various MV* patterns need not all be on the browser, nor do they all need to be written in JavaScript. Many popular frameworks allow for maintaining a model on the server and communicating with it using JSON.

Object.observe may not be available on all browsers yet, but there are polyfills that can be used to create a similar interface. The performance is not as good as the native implementation, but it is still usable.

Get Mastering JavaScript Design Patterns - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.