i dont know if im missing something but there are two
problems here.

1. polymorphic handling for different documents
2. figuring out which handler to call

the first is solved by the strategy pattern. the
second can be solved via chain of responsibility or
intercepting filter.

-saad

--- Chad Osgood <[EMAIL PROTECTED]> wrote:
> Yes, you're going to have to think of the Strategies
> as subclasses,
> because in the strategy pattern that is what they
> are.  Without the
> Strategy interface you couldn't be able to choose
> the Strategy without
> changing the context, so you would break the
> pattern.  Whether you
> decide to use a switch statement, a parameterized
> factory method, or
> any other means to actually determine which Strategy
> to create and
> use, you will still need to return an interface.
>
> Kind regards,
> Chad
>
>
> On Mon, 28 Mar 2005 07:19:12 -0500, Bill Bassler
> <[EMAIL PROTECTED]> wrote:
> > Hopefully where you have '// Use Strategy X' you
> are instantiating a
> > particular strategy object and then using that
> instance when you
> > instantiate your context object.  If you are not
> doing that then you are
> > not really using the strategy pattern.
> >
> > Yes. This is where I'm instantiating the required
> Strategy object ... so I
> > think I'm O.K. I'm really trying to see if there's
> a pattern-based way to
> > determine which Strategy to instantiate instead of
> using a switch
> > statement ... which O.K. I guess ... doesn't use
> of the Factory method
> > pattern really refer to subclass creation. I guess
> I could think of the
> > Strategies as subclasses and then it fits.
> >
> > ===================================
> > This list is hosted by DevelopMentor(r)
> http://www.develop.com
> >
> > View archives and manage your subscription(s) at
> http://discuss.develop.com
> >
>
> ===================================
> This list is hosted by DevelopMentor�
> http://www.develop.com
>
> View archives and manage your subscription(s) at
> http://discuss.develop.com
>

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

===================================
This list is hosted by DevelopMentor�  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to