Ovidiu Predescu wrote: > On Thu, 17 Jan 2002 11:29:08 +0100, Sylvain Wallez <[EMAIL PROTECTED]> >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: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]