Summary

In this chapter, we covered the MVC pattern. MVC is a very important design pattern used to structure an application in three parts: the model, the view, and the controller.

Each part has clear roles and responsibilities. The model has access to the data and manages the state of the application. The view is a representation of the model. The view does not need to be graphical; textual output is also considered a totally fine view. The controller is the link between the model and view. Proper use of MVC guarantees that we end up with an application that is easy to maintain and extend.

The MVC pattern is the SoC principle applied to object-oriented programming. This principle is similar to how a new house is constructed or how a restaurant ...

Get Python: Master the Art of Design Patterns now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.