The MVC pattern in the real world

Our good old web application frameworks are based on the philosophies of MVC. Take the example of Django or Rails (Ruby): they structure their projects in the Model-View-Controller format except that it is represented as MTV (Model, Template, View) where the model is the database, templates are the views, and controllers are the views/routes.

As an example, let's take up the Tornado web application framework (http://www.tornadoweb.org/en/stable/) to develop a single-page app. This application is used to manage a user's tasks and the user has permissions to add tasks, update tasks, and delete tasks.

Let's see the design considerations:

  • Let's start with the controllers first. In Tornado, controllers have been defined ...

Get Learning Python Design Patterns - Second Edition 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.