Exception handling in the Zend framework
(written by Lawrence Krubner, however indented passages are often quotes)
Matthew Weier O’Phinney on handling exceptions in the Zend framework:
SourceZend Framework exceptions use the following pattern:
A top-level Zend_Exception class is defined, extending Exception, and providing forward compatibility with PHP 5.3 exception support (namely, the “additional exception” argument).
Each component defines a component-level exception extending Zend_Exception, named after the component: e.g., Zend_Application_Exception.
Subcomponents may optionally define additional exceptions, extending from their component exception class.
Only one exception per level in the hierarchy is supported.
This approach, while pragmatic, introduces some inflexibility:
No component may be distributed without Zend_Exception; this becomes a hard dependency.
In many cases, it would make sense to utilize and/or extend one of the various SPL exception classes.
However, due to the requirement that all exceptions derive from Zend_Exception, this is currently impossible.
Currently, developers must rely on exception messages to understand why and/or where an exception was thrown. This has led to several requests for translatable exceptions and/or development of unique exception codes – all of which lead to increased maintenance costs.
May 17, 2012 2:06 am
From free cell phone ringtones on MySql Workbench is a total waste of time
"I like it so much, http://dailybooth.com/freecellphoneringto free cell phone ringtones, jsneke,..."