Niclas Hedhman wrote:

In the given example, the author have decided that the selectors <configuration> shall contain component definitions. It beats me why this was chosen, instead of the standard defintion of components declared to implement the Services of interest.

I'm keen to hear how this should be done properly as I wrote
along those same lines with a selector/manager for a specific service.
I instantiated all the different implementations based on the manager
configuration and dealt with their lifecycle as there is no good
reference on how to load up the default ServiceManager with all
these different implementations of a service at runtime (a question
I posed in a previous thread).

As an example my service might be FileContentHandler, my
Selector/Manager could be FileContentHandlerManager.

Now I create XML, TXT, HTML FileContentHandler Implementations
and my hints are the extension (we'll avoid looking inside the file, this
is a question about selectors not how to handle real content).

So my generic Manager gets asked for a FileContentHandler with hint "TXT"
and returns TXTFileContentHandler.

If I decide to add CSVFileContentHandler later there is no need to modify
my code, I create the new impl, add it to the classpath and update the
manager's configuration so that it knows about the new hint.

How should I achieve this result without using a manager/hints and
without recompiling existing components? or is there a better
architecture that I'm ignorant of.

thanks,
Jon


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to