Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Name for the Strings that Define Magento Class Names

Magento uses a factory pattern for instantiating objects from classes

$model  = Mage::getModel('catalog/product'); //Mage_Catalog_Model_Product by default
$helper = Mage::helper('catalog/data');   //Mage_Catalog_Helper_Data by default

These strings are expanded into classnames, and the System can be configured to replace the default values.

What are, or should, these strings be called? I've been abusing the term URI (sometimes tempering the abuse with the phrase "URI-like"), but that's not really right. "Class Name" doesn't seem right either, as it could easily cause confusion (Are you talking about the factory class name, or the actual PHP class name?)

Anyone have any stabs at authority on this?

like image 740
Alan Storm Avatar asked Nov 30 '22 17:11

Alan Storm


1 Answers

This string is called class (model, block, helper - depends from usage context) alias. Alias naming rule is: group/entity.

Each module can define own group or define rewrites for existing one.

like image 133
Dmitriy Avatar answered Dec 05 '22 19:12

Dmitriy