What is the idea behind the Zend Framework Frontcontroller / dispatcher

Zend Framework FrontController implements Singleton and plus has some kind of paradigm plugin - what is the idea of ​​its architecture, maybe it implements a well-known paradigm? and if so, if you could give some links, where can I find information on the reasons that led to this particular paradigm?

+4
source share
1 answer

The main idea of ​​FrontController is to provide a single entry point to your application.

Quote from PoEAA :

The front controller consolidates all request processing by sending requests through a single handler object. This object can perform general behavior that can be changed at runtime using decorators. The handler then sends commands for request-specific behavior.

Other definitions:

Also see the chapter in the front controller reference manual :

Zend_Controller_Front implements the Front Controller pattern used in Model-View-Controller (MVC) applications. Its purpose is to initialize the request environment, route the incoming request, and then send any detected actions; it combines any responses and returns them when the process is complete.

About Being Singleton

Zend_Controller_Front also implements the Singleton pattern, that is, only one instance can be available at any given time. This allows it to also act as a registry onto which other objects of the sending process can be drawn.

For a general definition of singleton and a registry template, see:

About connecting

Zend_Controller_Front registers the plug-in broker with itself, allowing various events that it triggers to be observed by the plug-ins. In most cases, this gives the developer the ability to customize the process of sending to the site without the need to expand the front controller to add functionality.

A good detailed explanation of how the Zend Framework uses the Front Controller and what happens under the hood during MVQ rquest can be found in:

+8
source

Source: https://habr.com/ru/post/1305856/


All Articles