Chapter 2. Fundamentals

Design patterns are proven solutions to common development problems that can help us improve the organization and structure of our applications. By using patterns, we benefit from the collective experience of skilled developers who have repeatedly solved similar problems.

Historically, developers creating desktop and server-class applications have had a wealth of design patterns available for them to lean on, but it’s only been in the last few years that such patterns have been applied to client-side development.

In this chapter, we’re going to explore the evolution of the Model-View-Controller (MVC) design pattern and get our first look at how Backbone.js allows us to apply this pattern to client-side development.

MVC

MVC is an architectural design pattern that encourages improved application organization through a separation of concerns. It enforces the isolation of business data (models) from user interfaces (views), with a third component (controllers) traditionally managing logic, user input, and coordination of models and views. The pattern was originally designed by Trygve Reenskaug while he was working on Smalltalk-80 (1979), where it was initially called Model-View-Controller-Editor. MVC was described in depth in the Gang of Four’s 1994 book Design Patterns: Elements of Reusable Object-Oriented Software, which played a role in popularizing its use.

Smalltalk-80 MVC

It’s important to understand the issues that the original MVC pattern was aiming ...

Get Developing Backbone.js Applications 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.