You are on page 1of 4

DIGITAL ASSIGNMENT-2

DESIGN PATTERN

ARCHITECTURAL PATTERN DESIGN PATTERN


 Architecture mostly addresses  Design patterns are medium-scale
problems of distributed and mostly language-independent
functionality, system partitioning, abstractions using object oriented
protocols, interfaces, scalability, mechanisms and described by
reliability, security. UML diagrams which solve
commonly occurred problems in
software construction.
 An architecture is an abstraction of the  A design pattern is an established
layers in an application. solution to a commonly recurring
problem.
 Architecture is strategic.  Design is tactical.
 Architecture patterns are well  Design Patterns are well known
known patterns for solving patterns for solving technical
software application architecture problems in a way that has proven
problems. itself many times.
 eg:- MVC, MVVM, MVP  eg:- Behavioral, Structural,
Creational Patterns.
 Communicate with business  Use guidelines.
stakeholders.
 Manage uncertainity  Avoid uncertainity
 Conceptual integrity  Completeness
 High impact  Individual components
 Define guidelines  Communicate with developers

Difference between MVC and MVVM,MVP

MVC
The Model-View-Controller (MVC) architectural pattern separates an application into three main components:
the model, the view, and the controller.

Model–view–controller (MVC) is a software architectural pattern for implementing user interfaces on


computers.
View is a user interface. View displays data from the model to the user and also enables them to modify the
data.
Controllers are responsible for controlling the flow of the application execution. When you make a request
(means request a page) to MVC application, a controller is responsible for returning the response to that
request.

MVC

Advantage -

 Support for asynchronous request: MVC also supports asynchronous technique, which helps developers to
develop an application that loads very fast.

 Modification does not affect the entire model: Modification does not affect the entire model because model
part does not depend on the views part. Therefore, any changes in the Model will not affect the entire
architecture.

Disadvantage-

 Increased complexity

MVVM (Model View- ViewModel)

The Model-View-ViewModel pattern can be used on all XAML platforms. Its intent is to provide a clean
separation of concerns between the user interface controls and their logic.
MMVM

Why It has been developed

 To accomplish a natural pattern for XAML platforms. The key enablers of the MVVM pattern are the rich
data bindin.

 To provides separation of concerns.(it achieve S-0f solid pattern).

 To allow, developer-designer workflow. When the UI XAML is not tightly coupled to the code-behind.

 To increases application testability

Advantage

 Components to be swapped

 Internal implementation to be changed without affecting the others

 Components to be worked on independently

 Isolated unit testing

MVP

Model:
The Model represents a collection of classes that explains the business logic i.e. business model and the data model (data
access operations). It also defines the business rules for data means as how the data can be altered and manipulated.

View:
The View represents the user interface components such as CSS, jQuery, HTML, etc. View displays the data that is
received from the controller as the outcome. This also changes the model(s) into the user interface.

Controller:
The responsibility of the Controller is to process incoming requests. It gets the input from users via the View, then
processes the user's data through the Model, passing back the results to View. It normally acts as a mediator between the
View and the Model.

MVP Design Pattern: The MVP pattern is similar to the MVC pattern, wherein the controller is replaced by the
presenter. This pattern divides an application into three major aspects: Model, View, and Presenter.

Model:
The Model represents a collection of classes that explains the business model and the data model. It also defines the
business rules for data means as how the data can be altered and manipulated.

View:
The View represents the user interface components such as CSS, jQuery, HTML, etc. View displays the data that is
received from the controller as the outcome. This also changes the model(s) into the user interface.

Presenter:
The Presenter is responsible for addressing all user interface events on behalf of the view. It receives input from users
via the View, then process the user's data through the Model that passes the results back to the View. The View and the
Presenter are completely separated, unlike View and Controller, from each other and communicate to each other by an
interface. The Presenter also doesn’t handle the incoming request traffic like controller.

The key difference between the Model View Presenter model and the Model View ViewModel lies in the way
they update the view. The MVVM uses databinding to update the view whereas the presenter uses traditional
methods to update the view.

You might also like