Zend Framework FrontController implements Singleton and plus it has some kind a plugin "paradigm" , - what is the idea behind its architecture , maybe it implements some well known paradigm ? and if so then if u could give some links directions where I can find information about reasons that brought up that particular paradigm ?
The basic idea of a FrontController is to provide for a single point of entry to your application.
Quoting PoEAA:
The Front Controller consolidates all request handling by channeling requests through a single handler object. This object can carry out common behavior, which can be modified at runtime with decorators. The handler then dispatches to command objects for behavior particular to a request.
Further definitions:
Also see the chapter in the reference guide about the Front Controller:
Zend_Controller_Front implements a » Front Controller pattern used in » Model-View-Controller (MVC) applications. Its purpose is to initialize the request environment, route the incoming request, and then dispatch any discovered actions; it aggregates any responses and returns them when the process is complete.
About being a Singleton
Zend_Controller_Front also implements the » Singleton pattern, meaning only a single instance of it may be available at any given time. This allows it to also act as a registry on which the other objects in the dispatch process may draw.
For a General Definition of the Singleton and the Registry pattern see:
About being pluggable
Zend_Controller_Front registers a plugin broker with itself, allowing various events it triggers to be observed by plugins. In most cases, this gives the developer the opportunity to tailor the dispatch process to the site without the need to extend the front controller to add functionality.
A good detailed explanation how Zend Framework uses the Front Controller and what happens under the hood during an MVC rquest can be found in:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With