Magento creates and uses objects by using the factory design pattern. This means that instead of instantiating objects the traditional PHP way eg.

$object = new Object();

Magento uses a Factory to create it's objects eg.

$product = Mage::getModel('catalog/product');

Mage::helper('catalog') can also be used for instantiating the helper classes.


The string passed is used to identify the correct class to use. The first part before the slash is defined in the configuration file of the module in the model or helper section. After the slash is the path to the class from the appropriate folder with slashes swicthed for underscores.


The getGroupedClassName($type, $class) method within Mage_Core_Model_Config is used by each factory to get the full class name of the requested file.

The first arguament passed to the method is the type which would be (model, block or helper). The next argument is the string which was passed to the factory method.

The first searches through the config to first look for a rewrite of the class and then checks for the class existing as a non core class and if still not found it is checked as a core Magento class.