Design Patterns Front Controller vs Page Controller
Joined: Feb 28, 2002
I am on a project team dedciding weather to use a Front End Controller or a Page controlled in the MVC that we are setting up. The application will be Web Facing and will employ a wizard to help users navigate. Hence the tendency may be towards a Front end controler, rather than a Page Controller. But Front Controller seems rather complex and page controller requires seprate controller for each page. this inturn effects security. what would be some condsiderations when make such a decisions Any help is appreciated Jawahar
Joined: Aug 10, 2001
Use a framework that provides a Front Controller like Struts. It should be WAY past the point where we are building our own versions of these patterns now. Kyle
Jawahar, A good alternative to Struts to get the Front Controller behavior without having to write a lot of plumbing code is to use the more flexible MVC webapp portion of the lightweight frameworks provided by Spring. In Spring webapp MVC, you can declare a number of DispatcherServlets in your web.xml and each one can have a different strategy for resolving how URL's are mapped to Controllers that process the information from the HttpRequest. Using this technique, all your url mappings and the wiring of your application components are declared in hierarchically organized configuration files. Spring's lightweight JavaBean container infrastructure handles wiring up your application components. You can also use its AOP infrastructure to configure proxies/interceptors to handle your security infrastructure and transactions declaratively without having to resort to EJB. The Petclinic sample webapp shows how all this is done in its configuration files, web.xml, applicationContext.xml, and petclinic-servlet.xml.
kktec<br />SCJP, SCWCD, SCJD<br />"What we observe is not nature itself, but nature exposed to our method of questioning." - Werner Heisenberg
Joined: Jan 29, 2003
There could be such a thing as a dead simple front controller with a bunch of command pattern objects. The logic might be as primitive as
This is not a "feature rich" solution, but does just about the least possible work to delegate requests to appropriate commands.
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi