Model
Model
1. Model –
This level is considered the lowest level when compared with the View and
Controller. It primarily represents the data to the user and defines the storage
of all the application’s data objects.
2. Views –
This level is majorly associated with the User Interface(UI) and it is used to
provide the visual representation of the MVC model. In simpler terms, this
level deals with displaying the actual output to the user. It also handles the
communication between the user (inputs, requests, etc.) and the controller.
3. Controller –
This level takes care of the request handler. It is often considered as the
brain of the MVC system- a link, so to speak, between the user and the
system. The controller completes the cycle of taking the user output,
converting it into desired messages, and passing them on to the views(UI).
Benefits of MVC
● Organizes large-size web applications –
As there is segregation of the code among the three levels, it becomes extremely
easy to divide and organize web application logic into large-scale applications (which
are required to be managed by large teams of developers). The major advantage of
using such code practices is that it helps to find specific portions of code quickly and
allows the addition of new functionality with ease.
● Easily Modifiable –
Using the MVC methodology allows easy modification of the entire application.
Adding/updating the new type of views is simplified in the MVC pattern (as a single
section is independent of the other sections). So, any changes in a certain section of
the application will never affect the entire architecture. This, in turn, will help to
increase the flexibility and scalability of the application.
● Multiple Views –
In the MVC architecture, developing different view components for your model
component is easily achievable. It empowers you to develop different view
components, thus limiting code duplication as it separates data and business logic.