Magento 2 and Model-View-Controller architecture
Magento 2 uses Model-View-Controller (MVC) as the software architectural pattern, which is responsible mainly for organizing the entire system's process structure at the coding level and establishing the means for the system to be flexible and extensible.
MVC distinguishes three layers of software activities, aiming for high cohesion and loosely coupling the modules responsible for the operation of Magento 2 systems. The three layers are described as follows:
- Model: The system modeling layer. Its main scope is handling system business rules and data persistence.
- View: This is responsible for the user information display layer, such as the product page and contact form.
- Controller: This is the layer that defines the main actions, requests, and responses of clients that may change the model's state and generate data views of the model layer.
It's important to define these concepts so you can develop well. Even when dealing with...