avalon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Leo Sutic" <leo.su...@inspireinfrastructure.com>
Subject RE: Avalon Bundles (was Re: [RT] Distilling the requirements for Block Support)
Date Fri, 18 Apr 2003 17:52:51 GMT


> From: Berin Loritsch [mailto:bloritsch@apache.org] 
>
> Cool, so what do you want to borrow from the OSX Bundle,
> and what I outlined?

(very long and incoherent text by me cut here.)

    Let's keep it simple.

What we need dependency wise is this:

 + A way to declare that a bundle provides a certain interface
specification.

 + A way to declare that a bundle provides an implementation of an
interface
   or set of interfaces.

 + A way to declare that a bundle provides an implementation of an
interface
   defined by another bundle or set of bundles.

That's it. Anything else - how bundles are configured etc. is out of
scope.

Let's look at the use cases:

 + A bundle provides an interface specification:

   Bundle http://cocoon.apache.org/serializer/1.0 provides a Serializer 
   interface for XML serialization.

 + A bundle provides an implementation of an interface specification:

   Bundle http://xml.apache.org/fop/1.0 provides an implementation of 
   http://cocoon.apache.org/serializer/1.0 that serializes FO to PDF.

 + A bundle provides an implementation of an interface specification
   not in another bundle:

   Bundle http://xml.apache.org/fop/0.9 provides implementation of
   the org.apache.cocoon.PrimitiveSerializer interface (and maybe more 
   interfaces).

The interface bundles are trivial. You have the interface classes, and
their associated metadata. (OK, so we need metadata to get this thing
going. Big deal.) The bundle lists what classes in it are Avalon
interfaces. For example:

Bundle http://cocoon.apache.org/serializer/1.0:

org.apache.cocoon.serialization.Serializer
org.apache.cocoon.serialization.SpecialSerializer
...

Possible this can be skipped - the classloader could check which
classes are Avalon interfaces, but let's keep it very simple and 
stupid.

The implementation bundles are a bit tricker, but still simple.
Inside each bundle, you declare what Avalon component class provides
which interface from the interface bundle.

http://cocoon.apache.org/serializer/1.0/org.apache.cocoon.serialization.
Serializer=org.apache.fop.FOPSerializer

The component classes can then be loaded by the container. The component
class will then contain metadata about what interface bundles it must
be able to find in its ServiceManager.

The lacing together basically boils down to this:

For Bundle X, which is depndent on Interface Bundle Y, provide
implementation
via Bundle Z. Possibly, one could be even more fine-grained: For Bundle
X, which 
is dependent on Interface Bundle Y, provide implementation of interface
Y1 via 
Bundle Z and interface Y2 via Bundle U.

/LS


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


Mime
View raw message