O'Reilly logo

Developing Backbone.js Applications by Adnan Osmani

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

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 to solve, ...

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