Front Controller pattern

Front Controller pattern

The Front Controller Pattern is a software design pattern listed in several pattern catalogs. The pattern relates to the design of web applications. It "provides a centralized entry point for handling requests." [Alur, "Core J2EE Patterns", p. 166.]

The front controller may manifest as a script in a script language like PHP, ASP, CFML or JSP that is called on every request of a web session. This script, for example an "index.php", would handle all tasks that are common to the whole application or the framework around, like session handling, caching, input filtering. Depending on the given input it would then instantiate further objects and call methods to handle the particular task.

The alternative to a front controller would be individual scripts like "login.php" and "order.php" that would each include the code or objects that are common to all tasks. This would need a repetition of the inclusion code in each script but might also leave more room for specific needs of a script.

Examples

Several web-tier application frameworks implement the Front Controller pattern, among them:
* Spring, a Java MVC framework
* Zend Framework

Notes

References

* cite book
last = Alur
first = Deepak
authorlink =
coauthors = John Crup, Dan Malks
title = Core J2EE Patterns, Best Practices and Design Strategies, 2nd Ed.
publisher = Sun Microsystems Press
date = 2003
location =
pages = 650pp
url =
doi =
id =
isbn = 0-13-142246-4

* cite book
last = Fowler
first = Martin
authorlink = Martin Fowler
coauthors =
title = Patterns of Enterprise Application Architecture
publisher =
date =
location =
pages = 560pp
url = http://www.martinfowler.com/books.html#eaa
doi =
id =
isbn = 978-0321127426

* Fowler, Martin. [http://www.martinfowler.com/eaaCatalog/frontController.html "Front Controller"] . Accessed Feb 2 2008.


Wikimedia Foundation. 2010.

Игры ⚽ Нужна курсовая?

Look at other dictionaries:

  • Controller area network — Controller–area network (CAN or CAN bus) is a vehicle bus standard designed to allow microcontrollers and devices to communicate with each other within a vehicle without a host computer. CAN is a message based protocol, designed specifically for… …   Wikipedia

  • Model–view–controller — A general representation of the MVC design pattern. Model view controller concept. The solid line represents a direct as …   Wikipedia

  • Model-view-controller — (MVC) is an architectural pattern used in software engineering. Successful use of the pattern isolates business logic from user interface considerations, resulting in an application where it is easier to modify either the visual appearance of the …   Wikipedia

  • Software design pattern — In software engineering, a design pattern is a general reusable solution to a commonly occurring problem within a given context in software design. A design pattern is not a finished design that can be transformed directly into code. It is a… …   Wikipedia

  • Model View Controller — Konzept. Hinweis: die durchgezogene Linie symbolisiert eine direkte Assoziation, die gestrichelte eine indirekte Assoziation (zum Beispiel über einen Beobachter). Model View Controller (englisch  model view controller (MVC), deutsch auch: M …   Deutsch Wikipedia

  • Game controller — A North American Super Nintendo game controller A game controller is a device used with games or entertainment systems used to control a playable character or object, or otherwise provide input in a computer game. A controller is typically… …   Wikipedia

  • Шаблон проектирования — У этого термина существуют и другие значения, см. Паттерн. В разработке программного обеспечения, шаблон проектирования или паттерн (англ. design pattern) повторимая архитектурная конструкция, представляющая собой решение проблемы… …   Википедия

  • Структурные шаблоны проектирования — Структурные шаблоны  шаблоны проектирования, в которых рассматривается вопрос о том, как из классов и объектов образуются более крупные структуры. Использование Структурные шаблоны уровня класса используют наследование для составления… …   Википедия

  • Шаблоны J2EE — Шаблоны J2EE  набор шаблонов проектирования, описывающих архитектуру серверной платформы для задач средних и крупных предприятий. Эти шаблоны рекомендуется применять при проектировании приложений с использованием java архитектуры J2EE для… …   Википедия

  • Spring Framework — Infobox Software name = Spring Framework caption = developer = [http://www.springsource.com SpringSource] latest release version = 2.5.5 latest release date = release date|2008|06|23 latest preview version = latest preview date = operating system …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”