Controller servlet?
Hi there!
I am re-writing a web application using design patterns, actually for learning DP.
I am using JSP at front end. I have this doubt, which hopefully you experienced guys have answers for.
1. I have a Controller class (servlet), which calls a appropriate Action class when some action takes place at view.
view -> Controller -> Action -> Model (business logic)
My doubt here is, does Controller (servlet) fall into any of the design patterns group? It does an useful job of instantiating and calling appropriate action class and thereby decoupling view and model.
Thanks very much
-Mahi
[652 byte] By [
mahi18a] at [2007-9-28 11:03:03]

It is a Front Controller (a J2EE pattern):
http://developer.java.sun.com/developer/restricted/patterns/FrontController.html
http://java.sun.com/blueprints/patterns/FrontController.html
I do not think that an applicable GoF pattern exists. J2EE patterns are pretty big patterns; they are more like building blocks for applications and provide solutions to very concrete problems. I suppose GoFs could be called "micro patterns" because they are so small (and abstract) and usable for a variety of purposes.
And, of course, probably your architecture is a server-side implemenation of the infamous Model-View-Controller pattern. (Model = business logic/data, View = JSP, Controller = controller servlet)
> It is a Front Controller (a J2EE pattern):
Thanks for the information aritt!!
> And, of course, probably your architecture is a
> server-side implemenation of the infamous
> Model-View-Controller pattern. (Model = business
> logic/data, View = JSP, Controller = controller
> servlet)
yes it is! But isn't MVC a Framework rather than a pattern?
- Mahi