Drupal as an MVC Framework
"Software architecture" - these words usually scare most freelance web developers. 3-Tier, MVC, Singleton, Factory ... “Wait! stop it! why complicate things? ”- they would say to you in response -“ Well, for example, Drupal - they’ve done Temko, the modules have been tweaked, configured, and basically the site is ready. ”Indeed, CMS Drupal provides an excellent platform for rapid development, while requiring minimum amount of effort.
Many have probably heard of such a concept as “Drupal ideology” - this is exactly what made this CMS so convenient and efficient platform. But perhaps few realize that the ideology mentioned is based on the well-known MVC pattern, or Model-View-Controller.

The MVC pattern (i.e. design pattern) consists of three interconnected elements: Model, Representation, and Controller. This separation of components allows you to distinguish between user interfaces, control logic and content.
A model is actually content, data that reflects a subject area and is structured in accordance with some kind of scheme, for example, in the form of relational database tables (MySQL, PostgreSQL, MS SQL Server, Oracle). The so-called DB API (a set of functions for working with the database) is also part of the Model. In addition, the Model includes program code that defines data types and their properties and relationships.
From the point of view of Drupal, the Model is a DB plus such modules as node.module, taxonomy.module, CCK. Other third-party modules, along with their basic functions, can also supplement the Model with their data types or with the functions of communicating with the database.
The controller interprets the data entered by the user, performs a state change depending on user actions, manipulates the entities of the Model so that they can be turned into a View, and generally does everything so that the system gears spin. In Drupal, the Controller is a basic module such as path.module, a menu system, hooks, an index.php file that collects and loads the system, etc. Also, all logic implemented by additional modules is part of the Controller.
Representationresponsible for displaying the Model to the user. In the case of Drupal, these are the final pages of the site, compiled by the Controller based on requests from the visitor and the current Model. The View includes page templates written in the PHPTemplate engine, CSS style files, Javascript, which is responsible for the tweaks in the interface. Through the View, the user communicates with the site - the Controller only processes the HTTP GET and POST requests sent by the browser, interprets the URL, and then forms the View again and transfers it to the user computer.
Fast and effective website development on Drupal is possible due to the fact that the described model allows you to divide the problem to be solved into separate components, and ready-made solutions are offered for the implementation of each of these components. There is no need to reinvent your Model or Controller - please apply the recommended circuit. It is often possible to get by with just a few changes in the View to create a full-fledged Drupal web application. But if there is a need to implement a specific logic or structure of the content, then for this it is enough to implement your parts of the Controller and Model, adding or changing existing versions.
This approach has already proven itself in technologies such as ASP.NET, J2EE, Spring. DrupalBeing a content management system, I quite successfully adopted this experience, in fact offering a full-fledged platform for creating any type of websites based on MVC architecture in the most common LAMP (Linux-Apache-MySQL-PHP) bundle today. Undoubtedly, this CMS has much to improve, including in this direction, but today it can be used as a powerful web development tool.
PS. The author of the topic is the alirasirin habrayuzer , all the pluses, if any, are hers .
Many have probably heard of such a concept as “Drupal ideology” - this is exactly what made this CMS so convenient and efficient platform. But perhaps few realize that the ideology mentioned is based on the well-known MVC pattern, or Model-View-Controller.

The MVC pattern (i.e. design pattern) consists of three interconnected elements: Model, Representation, and Controller. This separation of components allows you to distinguish between user interfaces, control logic and content.
A model is actually content, data that reflects a subject area and is structured in accordance with some kind of scheme, for example, in the form of relational database tables (MySQL, PostgreSQL, MS SQL Server, Oracle). The so-called DB API (a set of functions for working with the database) is also part of the Model. In addition, the Model includes program code that defines data types and their properties and relationships.
From the point of view of Drupal, the Model is a DB plus such modules as node.module, taxonomy.module, CCK. Other third-party modules, along with their basic functions, can also supplement the Model with their data types or with the functions of communicating with the database.
The controller interprets the data entered by the user, performs a state change depending on user actions, manipulates the entities of the Model so that they can be turned into a View, and generally does everything so that the system gears spin. In Drupal, the Controller is a basic module such as path.module, a menu system, hooks, an index.php file that collects and loads the system, etc. Also, all logic implemented by additional modules is part of the Controller.
Representationresponsible for displaying the Model to the user. In the case of Drupal, these are the final pages of the site, compiled by the Controller based on requests from the visitor and the current Model. The View includes page templates written in the PHPTemplate engine, CSS style files, Javascript, which is responsible for the tweaks in the interface. Through the View, the user communicates with the site - the Controller only processes the HTTP GET and POST requests sent by the browser, interprets the URL, and then forms the View again and transfers it to the user computer.
Fast and effective website development on Drupal is possible due to the fact that the described model allows you to divide the problem to be solved into separate components, and ready-made solutions are offered for the implementation of each of these components. There is no need to reinvent your Model or Controller - please apply the recommended circuit. It is often possible to get by with just a few changes in the View to create a full-fledged Drupal web application. But if there is a need to implement a specific logic or structure of the content, then for this it is enough to implement your parts of the Controller and Model, adding or changing existing versions.
This approach has already proven itself in technologies such as ASP.NET, J2EE, Spring. DrupalBeing a content management system, I quite successfully adopted this experience, in fact offering a full-fledged platform for creating any type of websites based on MVC architecture in the most common LAMP (Linux-Apache-MySQL-PHP) bundle today. Undoubtedly, this CMS has much to improve, including in this direction, but today it can be used as a powerful web development tool.
PS. The author of the topic is the alirasirin habrayuzer , all the pluses, if any, are hers .