0% found this document useful (0 votes)
51 views

MVC Model

Uploaded by

yogesh deo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
51 views

MVC Model

Uploaded by

yogesh deo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 6

MVC Model

The Model-View-Controller (MVC) framework is an architectural/design pattern that separates an application into three
main logical components Model, View, and Controller. Each architectural component is built to handle specific
development aspects of an application. It isolates the business logic and presentation layer from each other.
MVC was created by Trygve Reenskaug. The main goal of this design pattern was to solve the problem of users
controlling a large and complex data set by splitting a large application into specific sections that all have their own
purpose.

Features of MVC :
It provides a clear separation of business logic, Ul logic, and input logic.
It offers full control over your HTML and URLs which makes it easy to design web application architecture.
It is a powerful URL-mapping component using which we can build applications that have comprehensible and
searchable URLs.
It supports Test Driven Development (TDD).
Components of MVC :
Model:
Represents the application's data and business logic.
Manages the data, logic, and rules of the application.
Responds to requests for information, updates its state, and notifies observers (usually views) when the state changes.

View:
Represents the user interface and displays information to the user.
Observes the model and updates the interface when the model changes.
Multiple views can be associated with a single model, and a view can be reused with different models.

Controller:
Handles user input and manages the flow of data between the model and the view.
Listens for user actions, processes them, and updates the model or view accordingly.
Decouples the user interface from the underlying data and business logic.

The key idea behind MVC is separation of concerns, where each component has a specific role and is responsible for a
particular aspect of the application. This separation makes the code more modular, easier to maintain, and facilitates
collaboration among developers.
The MVC architectural pattern allows us to adhere to the following design principles:

1. Divide and conquer. The three components can be somewhat independently designed.
2. Increase cohesion. The components have stronger layer cohesion than if the view and controller were
together in a single UI layer.
3. Reduce coupling. The communication channels between the three components are minimal and easy to find.
4. Increase reuse. The view and controller normally make extensive use of reusable components for various
kinds of UI controls. The UI, however, will become application-specific, therefore it will not be easily reusable.
5. Design for flexibility. It is usually quite easy to change the UI by changing the view, the controller, or both.
Advantages of MVC:
• Codes are easy to maintain and they can be extended easily.
• The MVC model component can be tested separately.
• The components of MVC can be developed simultaneously.
• It reduces complexity by dividing an application into three units. Model, view, and controller.
• It supports Test Driven Development (TDD).
• It works well for Web apps that are supported by large teams of web designers and developers.
• This architecture helps to test components independently as all classes and objects are independent of each
other
• Search Engine Optimization (SEO) Friendly.

Disadvantages of MVC:
• It is difficult to read, change, test, and reuse this model
• It is not suitable for building small applications.
• The inefficiency of data access in view.
• The framework navigation can be complex as it introduces new layers of abstraction which requires users to
adapt to the decomposition criteria of MVC.
• Increased complexity and Inefficiency of data

You might also like