MVC Stands for Model View Control. It is basically a structure to ensure single responsibility of each part of the software and when making a change in one layer doesn’t affect how the rest of your code works. MVC separates application into three components – Model, View and Controller.
- Model : The model is responsible for managing the data of the application.
- View : View is a user interface. View display data using model to the user and also enables them to modify the data.
- Controller : Controller handles the user request. Typically, user interact with View, which in-tern raises appropriate URL request, this request will be handled by a controller. The controller renders the appropriate view with the model data as a response.
What are the benefits of following MVC architecture?
- MVC architecture comes in handy when your designers dont know how to write logic code and vice versa; because it elegantly separates the presentation from the backend. The advantage of doing this is that it is highly organized and highly maintainable. It separates your presentation layer from the logic, thereby minimizing the clutter.
- In a dynamic and complex web application, MVC is a good way to go about the development because if you dont follow it, there is a high possibility that your code becomes cluttered and buggy!
- Parallel development of UI and Backend by separate teams.
- Attach multiple views to a model to provide different presentations (view/model decoupling)
- Change the way a view responds to user input without changing its visual presentation (view/controller decoupling)