Answered by: Mitchel KAnswered On : Jun 27th, 2005
A design pattern describes a proven solution to a recurring design problem, placing particular emphasis on the context and forces surrounding the problem, and the consequences and impact of the solution.
There are many good reasons to use design patterns. Here are three:
1) They are proven. You tap the experience, knowledge and insights of developers who have used these patterns successfully in their own work.
2) They are reusable. When a problem recurs, you don't have to invent a new solution; you follow the pattern and adapt it as necessary.
3) They are expressive. Design patterns provide a common vocabulary of solutions, which you can use to express larger solutions succinctly.
The goal of the MVC design pattern is to separate the application object (model) from the way it is represented to the user (view) from the way in which the user controls it (controller).
The MVC architecture has the following benefits:
1) Multiple views using the same model: The separation of model and view allows multiple views to use the same enterprise model. Consequently, an enterprise application's model components are easier to implement, test, and maintain, since all access to the model goes through these components.
2) Easier support for new types of clients: To support a new type of client, you simply write a view and controller for it and wire them into the existing enterprise model.
3) Clarity of design: By glancing at the model's public method list, it should be easy to understand how to control the model's behavior. When designing the application, this trait makes the entire program easier to implement and maintain.
4) Efficient modularity: of the design allows any of the components to be swapped in and out as the user or programmer desires - even the model! Changes to one aspect of the program aren't coupled to other aspects, eliminating many nasty debugging situations. Also, development of the various components can progress in parallel, once the interface between the components is clearly defined.
5) Ease of growth: Controllers and views can grow as the model grows; and older versions of the views and controllers can still be used as long as a common interface is maintained.
6) Distributable: With a couple of proxies one can easily distribute any MVC application by only altering the startup method of the application.