I went through some articles which describes Magento architecture.

As we all knows Magento uses MVC ( Model-View-Controller ) architecture. It separates the business logic, data access layer and user view.

Some articles say business logic resides in Block classes whereas some other articles say it is in Model classes (With respect to Magento modules). This is bit conflicting information.

Can anyone provide better explanation on this?

3 Answers 3


The ultimate answer is that Magento business logic is located wherever you eventually find it. You will find Magento business logic everywhere from the SQL database to the style sheets.

If you are looking for business logic, expect to be disappointed by the lack of adherence to conventions or good practice, and be prepared to comb through every aspect of the platform.

Even if you are writing your own extensions, it is probably better to stick with Magento's peculiar vernacular(s). Attempting otherwise is a Sisyphean task that will make you code less accessible to other Magento developers. I generally mimic similar structures from the core, even if I think they are written poorly.


Magento controller is almost the same as other MVC design pattern

Magento Models includes business model and resource models, Each entity should have its business model, resource model and a collection. Business models talk to database entity through relative resource models. They do not talk directly to database.

Magento Views includes Blocks and Templates.

Each controller defines its relative blocks or load blocks dynamically according to layout xml configuration files.

Blocks ask for help from Business Models and Helpers for preparing data to Templates.

There are many more stuff inside magento but keep it simple like this helps me reading magento source more easily. I hope it helps you too.


MVC stands for Model-View-Controller. Any application that separates it’s data access, business logic and user interface is called MVC. There can be two types of MVC: convention-based and configuration-based.

Example, cakePHP is convention-based, i.e. you just need to follow the instructions of the core system to get your module ready in just few lines. Magento is configuration-based, i.e. you need to specify each and every thing to your module’s config file in order to get it work.

Blocks - Each Block object will render a specific bit of HTML. Block objects do this through a combination of PHP code, and including PHP .phtml template files. Blocks objects are meant to interact with the Magento system to retrieve data from Models, while the phtml template files will produce the HTML needed for a page

Models - Magento offers an Object Relational Mapping (ORM) system. ORMs get you out of the business of writing SQL and allow you to manipulate a datastore purely through PHP code (and other core business logics)

For more Information Magento for Developers: Part 1 - Introduction to Magento

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.