Skip to main content
Tweeted twitter.com/StackMagento/status/715486568543162368
edited tags
Link
added 306 characters in body
Source Link
Ronen Ness
  • 587
  • 6
  • 19

I heard conflicts opinions about weather or not one should only inherit from Mage_Core_Helper_Abstract, even when none of the helper built-ins are used.

So if I have couple of helper classes that I get using the magento Mage::helper() api, but those helpers don't use anything from Mage_Core_Helper_Abstract, should I still inherit from it?

My tendency goes with yes for good practice, but maybe there are performance / resources waste involved that I'm not aware of.

Thoughts?

EDIT: I saw examples in Magento code of helpers that inherit from helper abstract without using its functions (http://freegento.com/doc/d3/d82/_helper_2_string_8php-source.html). So unless someone gives me a good reason why I shouldn't do it, I think I'll go with "always inherit from helper abstract".

I heard conflicts opinions about weather or not one should only inherit from Mage_Core_Helper_Abstract, even when none of the helper built-ins are used.

So if I have couple of helper classes that I get using the magento Mage::helper() api, but those helpers don't use anything from Mage_Core_Helper_Abstract, should I still inherit from it?

My tendency goes with yes for good practice, but maybe there are performance / resources waste involved that I'm not aware of.

Thoughts?

I heard conflicts opinions about weather or not one should only inherit from Mage_Core_Helper_Abstract, even when none of the helper built-ins are used.

So if I have couple of helper classes that I get using the magento Mage::helper() api, but those helpers don't use anything from Mage_Core_Helper_Abstract, should I still inherit from it?

My tendency goes with yes for good practice, but maybe there are performance / resources waste involved that I'm not aware of.

Thoughts?

EDIT: I saw examples in Magento code of helpers that inherit from helper abstract without using its functions (http://freegento.com/doc/d3/d82/_helper_2_string_8php-source.html). So unless someone gives me a good reason why I shouldn't do it, I think I'll go with "always inherit from helper abstract".

improved formatting
Source Link
Qaisar Satti
  • 32.6k
  • 18
  • 88
  • 138

I heard conflicts opinions about weather or not one should only inherit from Mage_Core_Helper_AbstractMage_Core_Helper_Abstract, even when none of the helper built-ins are used.

So if I have couple of helper classes that I get using the magento Mage::helper()Mage::helper() api, but those helpers don't use anything from Mage_Core_Helper_AbstractMage_Core_Helper_Abstract, should I still inherit from it?

My tendency goes with yes for good practice, but maybe there are performance / resources waste involved that I'm not aware of.

Thoughts?

I heard conflicts opinions about weather or not one should only inherit from Mage_Core_Helper_Abstract, even when none of the helper built-ins are used.

So if I have couple of helper classes that I get using the magento Mage::helper() api, but those helpers don't use anything from Mage_Core_Helper_Abstract, should I still inherit from it?

My tendency goes with yes for good practice, but maybe there are performance / resources waste involved that I'm not aware of.

Thoughts?

I heard conflicts opinions about weather or not one should only inherit from Mage_Core_Helper_Abstract, even when none of the helper built-ins are used.

So if I have couple of helper classes that I get using the magento Mage::helper() api, but those helpers don't use anything from Mage_Core_Helper_Abstract, should I still inherit from it?

My tendency goes with yes for good practice, but maybe there are performance / resources waste involved that I'm not aware of.

Thoughts?

Source Link
Ronen Ness
  • 587
  • 6
  • 19
Loading