cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Berin Loritsch <blorit...@infoplanning.com>
Subject Re: Avalon explainations
Date Thu, 10 Aug 2000 14:06:41 GMT
Eric SCHAEFFER wrote:

> > Inside the ImageReaderFactory, you can access the image-readers through
> > a NamedComponentManager using the class names as the type (unless you
> > wanted a shorter name).  The framework assists in many areas, but
> > be careful to use the right tool for the right job.
> >
> I'm not sure to understand you.
> 
> My ImageReaderFactory uses a list of classes that implement the ImageReader
> interface. It only asks each of its ImageReader instances to try to read the
> image headers. If an ImageReader instance can read it, the image is of the
> type the ImageReader can handle. For a Gif image, there's only one
> ImageReader class. But using a configurable factory enable users to add
> their own image readers (for other image types by example).

In that case, you don't really need the NamedComponentManager for what you
are doing.  For this purpose the Factory pattern is better than Component
Manager pattern.

Yes using a configurable factory does enable users to add their own image
readers, and there are a number of ways of accomplishing the task of adding
handlers.  I need to incorporate a package browser utility to the Avalon
framework that you would be able to specify that every class within a package
would be an ImageReader (it will probably have a sanity check to see if the
class implements or extends a specified interface/class).

But, being strapped for time....

I do have some code to start with that can be updated.

Mime
View raw message