> From: news [mailto:[EMAIL PROTECTED] On Behalf Of Leo Simons
> 
> Leo Sutic wrote: <snip/>
> 
> I think we agree :D
> 
> now what?

I thought I'd leave that up to you...

OK, now that we know what to build, let's start thinking about how
to get there.

The problem is that we suddenly need one more bit of metadata: Is the
interface stateful or stateless?

So suppose we move to a Plugin based container as we outlined:

    public interface Plugin {
        /**
         * @returns Factory if interface is stateful, component 
         *          interface if stateless
         */
        public Object get ();
        public void put (Object o);
    }

Then we have the situation that we have a lot of old A4 components,
but we have a new Client.

Then we configure our old components:

    <component role="my.old.SAXTransformer" class="..."
plugin="stateful"/>
    <component role="my.old.MailServer" class="..." plugin="stateless"/>
    <component role="my.new.Client" class="..." plugin="stateless"/>

So far so good...

Our client does a lookup(my.old.SAXTransformer.ROLE) and gets a Factory.

Fine.

Our client does a lookup(my.old.MailServer.ROLE) and gets a MailServer.

Fine.

Then the MailServer looks up the SAXTransformer and gets a Factory.

Not fine.

So we need to define the client type to handle backwards compatibility:

    <component role="my.old.SAXTransformer" class="..." 
        plugin="stateful" client="A4"/>
    <component role="my.old.MailServer" class="..." 
        plugin="stateless" client="A4"/>
    <component role="my.new.Client" class="..." 
        plugin="stateless" client="jicarilla"/>

Our client does a lookup(my.old.SAXTransformer.ROLE) and gets a Factory.

Fine.

Our client does a lookup(my.old.MailServer.ROLE) and gets a MailServer.

Fine.

Then the MailServer looks up the SAXTransformer. The lookup() is handled
by a proxy, which gets a Factory from the passed-on lookup(). The
Factory
is cached under the lookup key, and the proxy does a get() on the
factory,
and returns a SAXTransformer.

Fine.

So we need two types of plugins:

 1. A component handler plugin. (For example, a plugin that manages A4 
    components.)

 2. A client-side adapter plugin. (For example, an adapter that converts

    the plugin-style lookups (with Factories) to A4 lookups, as outlined
    above.)

/LS


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

Reply via email to