Many applications out there share a similar architecture. Since usually applications have similar data flow, it is obvious for them to comply with the best standard for the architecture, something tried and tested. Model-View-Controller, or MVC, is one of the most commonly used architecture patterns that is used in development almost all web applications, and is also used in variety of other applications.
MVC is a great compound pattern that organizes application structure very well. And while MVC might be confusing at first, it would be helpful to understand what are the patterns that it is comprised of.
Knowing from its name, there are three main components: model, view, and controller. The model is responsible for containing all of the data, state, and application logic, or often times referred to as business logic. View is something that presents the data to the client. It gives you a presentation of the model. Most often view is also referred to as user interface. It has a sole responsibility to present the data to the end-client. Controller is an intermediary actor β it helps facilitating communication between model and view: user interacts with view, view communicates with controller, and controller delegates logic to the model. Basically, it figures out what the input that it got from view means to the model.
All three components have their own way of behaving and representing the data. All of them use different kinds of patterns. The model, for instance, often implements the Observer Pattern. It keeps interested objects, i.e. view, updated when its own state changes. Using Observer pattern enables model to remain independent of view or controller. This approach can help us use multiple views or controllers with the same model.
The view on the other hand is often times implemented with Composite pattern. Since view is most frequently used for UI representation, it must consider all sorts of UI components. And those components can have children or be leaf nodes. For example, you can have a popup window with several buttons in it. The window is a node with several nested children β buttons. And buttons are leaf nodes. If controller or model send a signal to update the UI, the method can be applied to the topmost element, and then applied on all of the children respectively. Composite pattern fulfills all of the requirements in the best way possible.
Lastly, controller usually implements Strategy pattern together with view: the View is an object that is configured with a strategy, which is provided by the controller. View delegates all of the decision making in regards to behavior to the controller. Controller helps us to decouple view from the model, so that view has no idea how things are done. It only receives client input and commands from the top.
Such separation of the architecture allows for clear organization and defined responsibilities. Additionally, in web applications it serves as separation of production responsibilities. In web development there is front-end and back-end development. And those two can be very different from each other: one works on how it looks, the other works on how it functions. Thatβs why you find positions available for both. With MVC both front-end and back-end professionals can work side by side on separate modules of the same application.

MVC is one of the most widely used architecture patterns. You can find it almost in all of the web applications and good portion of desktop. Knowing MVC and underlying patterns should help in understanding how to approach this pattern, which component to modify, and even how to divide responsibilities within the development team.




