/patterns

Patterns of programming and design

MIT LicenseMIT

patterns

Patterns of programming and design

Design

Model-view-controller (MVC)

Concept

It is used for implementing user interfaces. The main idea is to divide program into three interconnected components.

Components

  • Model
  • View
  • Controller

Interactions

Controller manipulates the model so it changes and view receives model's updates. Then view shows it for user. User sees updates and uses the program; user's actions encourage controller to manipulate the model again.

Examples

Useful links

MVC implementation for JavaScript (habrahabr)

Unit testing