In typical mvc ...we are direct calling view from controller... and also some other task without xml help....

In magento every thing is loaded by xml...

And magento is very slow...and reflection rate is to low...

After any changes you must have to delete cache....

And in other you can use caching where its is needed....

BAsically need to know why magento using xml....


In Magento the MVC concept is a little different. An honestly I like this way more than the classical one.
In Magento, controllers are very light. they only handle the request and send the response. They don't talk to the views (in most of the cases. There are cases when they do) they just load them and display them.
Also Magento does not have the restriction, that I don't understand, that views should not talk to models. For Magento views can access models.

The xml part is for extensibility. The controller only loads the set of blocks (that are basically views but in an OOP format) assigned for a specific request and displays them. Then each block does his part for retrieving and displaying data.

Using an xml makes it easy for developers to add stuff in a page.
All the layout xmls are merged into one big xml and that one is used by the controllers. The controller does not care where a block comes from. If it's in the merged xml it instantiates it and displays it.

This is a very broad topic and I could go on for a few more pages. But I won't. You can read Magento Designers Guide to get a better idea about why layout xmls are used and how to use them

| improve this answer | |

Magento is using a "Configuration-Based MVC" See here: http://www.magentocommerce.com/knowledge-base/entry/magento-for-dev-part-1-introduction-to-magento


| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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