cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Berin Loritsch <blorit...@apache.org>
Subject Re: org.apache.cocoon.sitemap.Handler a Component?
Date Thu, 17 Jan 2002 18:15:36 GMT
Ovidiu Predescu wrote:

> On Thu, 17 Jan 2002 11:29:08 +0100, Sylvain Wallez <sylvain.wallez@anyware-tech.com>
wrote:
> 
> I noticed in your TreeProcessor implementation that you in fact
> duplicate a lot of code which is in the Handler class. I am trying to
> come up with a scheme where by simply changing the Handler class, and
> maybe the SitemapManager, you can hook up different engines for the
> sitemap.
> 
> This would allow me for example to hook up a totally new, Scheme
> based, implementation of the sitemap. Perhaps you can do exactly the
> same thing with the TreeProcessor implementation.



If that's the case, explore using the Factory pattern.  The Handler class
then becomes a base class, and any time you need to create a new Handler,
you call the Factory to get the new instance (which is an extension of
Handler).

That would require a one time change to the SitemapManager--but after that,
it is fairly trivial to change the implementation of the Handler.  It still
isn't a Component, but it follows the same pattern that the ComponentHandler
stuff works on in Excalibur.


-- 

"They that give up essential liberty to obtain a little temporary safety
  deserve neither liberty nor safety."
                 - Benjamin Franklin


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Mime
View raw message