I'm trying to understand couple of things about helper classes scope and lifetime. I think I got it but it's critical for me to be sure.
So can you please tell me if I'm right about the following assumptions about helper's scope?
- a helper is a singleton by default (eg when calling
Mage::helper()it's the same as calling
- a singleton only live in the scope of the http request, eg next http request will no longer have those singletons. same rule applies to helpers.
- it's possible to use session storage for a helper, which will make the helper instance live through the entire user session, but by default it's not session based.
- calling the same helper from different modules (while handling the same request) will return the same instance. eg a helper singleton instance can be used to transfer data between modules? (I'm not asking if it's the right way, just if its possible :))
- calling the same helper from different events that are triggered from the same http request will return the same helper instance.
- calling helper from cron job callback will always instantiate a new instance (because cron job is equivalent to an http request scope?)
So am I correct about the points above? Can someone confirm it? I did some testing and found some info here and there, but I want to make sure it's the expected defined behavior, and not just random behavior that might change between versions and systems.