开发者

Design Patterns: What's the antithesis of Front Controller? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.

Want to improve this question? Update the question so it focuses on one problem only by editing this post.

Closed 5 years ago.

Improve this question

I'm familiar with the Front Controller pattern, in which all events/requests are processed through a single centralized controller.

But what would you call it when you wish to keep the various parts of an application separate at the presentation layer as well? My first thought was "Facade" but it turns out that's something entirely different.

In 开发者_JAVA技巧my particular case, I'm converting an application from a sprawling procedural mess to a clean MVC architecture, but it's a long-term process -- we need to keep things separated as much as possible to facilitate a slow integration with the rest of the system. Our application is web-based, built in PHP, so for instance, we have an "index.php" and an IndexController, a "account.php" and an AccountController, a "dashboard.php" and DashboardController, and so on.


PoEAA calls something like this a "Page Controller", one module on each web server acting as the controller for each page on the site.


Have a look at the Web Presentation Patterns of PoEAA:

  • Model View Controller - Splits user interface interaction into three distinct roles.
  • Page Controller - An object that handles a request for a specific page or action on a Web site.
  • Front Controller - A controller that handles all requests for a Web site.
  • Template View - Renders information into HTML by embedding markers in an HTML page.
  • Transform View - A view that processes domain data element by element and transforms it into HTML.
  • Two-Step View -Turns domain data into HTML in two steps: first by forming some kind of logical page, then rendering the logical page into HTML.
  • Application Controller - A centralized point for handling screen navigation and the flow of an application.


I'm confused exactly what you're asking here, because the presentation layer is already separate -- views provide that function. If you have common portions of a page that should exist in all views, perhaps you're looking for something like the View Helper pattern? Using existing PHP development frameworks like Zend_Framework or CakePHP or CodeIgniter have ways to do this built-in.


Adapter, Factory, and Strategy would all seem to be applicable ways of hiding an underlying code but like BillyONeal, I'm not sure what you are asking as it would appear that simply modularizing the code would work but I'm not aware of a modular pattern.


I would even go so far as to call it a Composition of Controllers. So you could call it Modular Composition Controller.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜