Sie sind auf Seite 1von 8

Abdessattar Ettaieb

At the end of this chapter you will be able to:
 Define a design pattern
 Identify the differences between the most common design patterns
in web development.
Design patterns are general and repeatable solution to a commonly
occurring problem in software design. They serve as common platform for
The MVC pattern was specifically designed in such way that the view
(presentation) and the model (data) don’t communicate directly.
MVC pattern allows developers to work simultaneously on different
components of a web application without impacting one another.
The Model contains the application data, it contains no logic or business.
The View displays the model’s data to the user. The view knows how to access
the model’s data, but it does not know what this data means or what the user
can do to manipulate it.
The Controller exists between the view and the model. It listens to events
triggered by the view and reacts to these events. Since the view and the model
are connected through a notification mechanism, the result of this action is then
automatically reflected in the view.
The MVC controller method doesn’t work as well with single page
The ViewModel isn’t a controller. Instead it binds data to the view and
MVVM is designed specifically to allow the view and model to communicate
directly with each other.
Single page applications work very well with ViewModels. Because of this,
MVVM single page applications can move quickly and fluidly and save
information to the database continuously (Google Docs is an example).
 The MVP pattern is derived from MVC pattern, wherein the controller is
replaced by the presenter.
 The Model describes the business logic and data.
 The View is a component which is directly interacts with user. It does not
contain any logic implemented.
 The Presenter receives the input from users via View, then process the
user’s data with the help of Model and passing the results back to the View.
Presenter communicates with view through interface.
 Singleton pattern is one of the simplest design patterns. This type of design
pattern provides one of the best ways to create an object.

 The singleton pattern is restricts the instantiation of a class to one object.

 This pattern involves a single class which is responsible to create an object

while making sure that only single object gets created. This class provides a
way to access its only object which can be accessed directly without need to
instantiate the object of the class.