MVC - Explain the model-view-controller pattern

Explain the model-view-controller pattern.

A pattern is defined as the structure / significant process for application development. The MVC pattern isolates the business logic for the user interface. The result of applying MVC pattern is to simplify the application development for visual appearance and the underlying business logic without affecting each other. A web application can be viewed as simple as that of consisting of only 3 parts irrespective of complexity. This gives the developers, web page authors and the database folks the flexibility to develop their individual goals or tasks.

As an architectural pattern it separates the presentation layer (the user interface), the domain logic and database access. The presentation layer is further divided into view and controller.

Explain the model-view-controller pattern.

Model-View-Controller (MVC) is a classic design pattern that offers applications an ability of maintaining multiple views of the same data.

The MVC pattern provides a clean separation of objects into

1. Models for maintaining data
2. Views for displaying all or a portion of the data
3. Controllers for handling events that affect the model or view(s).

Because of this separation, multiple views and controllers can interface with the same model.
New types of views and controllers that never existed before can interface with a model without forcing a change in the model design.
Components of MVC architecture, i.e. Model, view and controller
Components of MVC architecture - Model: In the MVC pattern, the component,” model” comprises the code that is to deal with the database (can be a simple java bean)...
MVC - Benefits of MVC pattern
Benefits of MVC pattern - Separation of concerns: The separation the three components, allows the re-use of the business logic across applications...
Explain the disadvantages of MVC pattern
Disadvantages of MVC pattern - The complexity is high to develop the applications using this pattern...
Post your comment