Do you find Zend_Registry useful?
For which tasks it should be used? For which not?
Global state for variables is not a good practice.
Main objects may have global state injected via $front->setParam('paramName', $object),
so what’s the purpose of Zend_Registry?.
Quoting PoEAA on Registry Pattern:
The main reason why I use the registry (when I use it) is because it creates an easily accessible application scope. With the registry, I don’t have to litter objects all over the global scope; only the Registry itself is global. It’s convenient to lookup whatever I’ve thrown into the Registry from everywhere, including the model:
However, just like with Singletons, Registry is often frowned upon. Here is an article by Brandon Savage with some thought about why not to use the Registry. The main arguments against the Registry are
Those who vote against the Registry usually advocate the usage of Dependency Injection, although it should be noted that you can inject the Registry as well once you got an instance of it. You do not have Inversion of Control then though, because the using object will pull what it needs from the Registry. Using the Registry as a Service Locator is a valid approach though.
See this article by Martin Fowler about ServiceLocator vs. Dependency Injection.
Like pointed out in the comments to your question,
Zend_Registryis not a strict Singleton. You can instantiate multiple instances where needed in addition to using the global instance you get withZend_Registry::getInstance(). So objects can have their own registry. But when using Registry this way, it’s basically just a glorified ArrayObject.Final note: just like with all Design Patterns, use it if applicable to your problem.