There is still the issue of implementing a decision tree in the
factory. You eventually have to pick a constructor to call...
I've always been big on table driven stuff. As you may have
guessed, a similar question came up recently...
Mike Marchywka
Senior Engineer
EyeWonder
2859 Paces Ferry Road
Suite 1200
Atlanta GA 30339
770-261-5084(W)
770-434-7510(H)
FAX: 770-261-5080
[EMAIL PROTECTED]
-----Original Message-----
From: rubisd [mailto:[EMAIL PROTECTED]]
Sent: Sunday, July 15, 2001 1:52 PM
To: [EMAIL PROTECTED]
Subject: Re: Servlet Design Question-Want to get rid of massive if/else
block
Hey!
You might look at the Design Pattern named Factory Method.
What you would have is a "Service Factory" that passes back
the required service object when passed the service name. Very
OO, and powerful technique. I use it exclusively when I
implement the Model View Control architecture.
Search on the above key words for more information. This is NOT new
stuff.
Sans adieu,
Danny Rubis
t t wrote:
> Thanks for the reply. Do you know anywhere on the web
> where there is an example of this. Either a
> article/tutorial or a *.java file I can download and
> have a look at?
>
> Cheers
>
> Tony
>
> --- Duane Morse <[EMAIL PROTECTED]> wrote:
> > One standard way is to create your own request
> > handler objects and put them
> > in a hash table with the request name/type as the
> > key. Or, put the objects
> > in
> > an array sorted by the request name/type and do a
> > binary search to find the
> > right one.
> >
>
> __________________________________________________
> Do You Yahoo!?
> Get personalized email addresses from Yahoo! Mail
> http://personal.mail.yahoo.com/
>
>
________________________________________________________________________
___
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the
body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources:
http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
________________________________________________________________________
___
To unsubscribe, send email to [EMAIL PROTECTED] and include in the
body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html