New to patterns
Hi,
I am completely new to design patterns and J2EE so any help would be useful.
I have a basic web page with an embedded flash movie which communicates with a single servlet.
The servlet is basically a big if...else statement on the request params from the flash. Each if...else calling an appropriate method, doing some work and returning something to the flash movie.
I have been asked by a customer if this the server side servlet would/could be extendable, I want to redesign the whole approach to use a design pattern (is this the right thing to do?), but I don't know really where to start or even if this is the right thing to do. Any help ideas?
I have started reading J2EE Design Patterns by William Crawford, Jonathan Kaplan (is this a good book?) and am thinking of something along the MVC lines with all the work done in a JavaBean, the customer will want to be able to add to the if...else in the controller servlet, preferably by some sort of extension without changing my code, how would something like this work? Is there a better pattern for what I'm trying to do?
Any help will be much appreciated.
Thanks in advance.
Phil Maskell
[1206 byte] By [
maskellpa] at [2007-9-29 19:54:53]

It is unclear how your customer would want to extend the servlet.
When you say redesign, do you also mean removing the Flash component? Flash conflicts a little with the J2EE model.
Checkout http://jakarta.apache.org/struts/ to learn how to build extensible Java web applications.
Some things to keep in mind:
Using a MVC pattern, the servlet would act as the Controller, which should delegate to helper classes that carry out actions. In Struts, the org.apache.struts.action.ActionServlet reads the request URL and delegates to the appropriate Action class. Highly extendable by adding and/or revising action classes.
The View layer would consist of your Flash application if you keep it in the new design. otherwise the View is implemented with JSP pages.
The Model layer is where your business logic resides. You would use a Business Delegate to interact with the Controller objects. If you keep using Flash, then it seems like your Model or business logic would be mixed in with the View Layer. It really depends on what type of business requirements the application is attempting to realize. Here is the area of conflict with J2EE model.
Christian