MVC, Model View Control Architecture is the most frequently used design pattern in software development. This design pattern divides presentation logic and business logic in two different layers. In MVC design pattern View represents presentation layer for example in web applications it could be JSP (Java Server Page) or JSF(Java Server Faces) or PHP or HTML.Model layer deals with the interaction with the database. As the name states , Controller will take responsibility of handling the request from client, which involves redirecting the request and response.
These all three layers are separated in such a manner that they don’t know anything about each other. Model layer doesn’t know how the view layer is handling the data. In the same manner View layer or presentation layer doesn’t know how the model is manipulating or processing the data. Also the controller layer doesn’t know how the data is processed by Model layer and how the data is rendered by View. It’s just accepts the request and pass on it to proper business logic or view that's it.
Let’s take a look at the MVC Architectural Diagram:
Advantages
Layered Architecture :
Maintainance is easy :
The major use in this architecture is that it separates the presentation layer and business logic layer.If any changes made to business logic layer , with little or no changes in presentation layer the application can be modified easily.Even if any changes happened in database layer can easily be adapted in model layer so that with less or without changes to presentation or business logic layer we can adapt the changes.
Maintainance is easy :
If I needed to add or delete a view on the front end, the model would be unaffected by this new change. Less code to change, less maintenance cost.
Client/server environment :
The web applications developed using the MVC architecture can easily be used in client / server architecture.
Disadvantages :
Frankly speaking, for some project, I really didn't encounter any problems. I'm think once used in a larger or more complex environment some would arise.
Overload on Controller Classes:
In case of larger application development you may have plenty of screens(views).Which may increase the load and size of controller.Of course you can have multiple controller to handle this kind of situations.But still in the MVC architecture this may stand as a disadvantage.
Comments