Geoff Howard wrote:

Stephen McConnell wrote:



Sylvain Wallez wrote:

Geoff Howard wrote:

Upayavira wrote:


<snip/>

So you won't be able to include and share arbitrary components between blocks? i.e. components that have arbitrary interfaces? They'll all have to follow interfaces that already exist within Cocoon? Or am I missing something?


No, you can include and expose arbitrary components. The interfaces he's referring to are the abstracted api interface of the component independant of its implementation but they are totally up to the author of the component.


...


We've said that direct classloading from the block is prohibited but here you need the definition of BlockSpecificDataStructure. So how do you permit one and deny the other? And does this get you into odd ClassCastExceptions where the same class from different classloaders are not recognized as identical?


We have here the exact same problem as Eclipse plugins. I you look at a plugin.xml file, you will see an runtime/library/export statements where are listed the classes (in the generic meaning, i.e. including interfaces) that are visible from outside the plugin. The classloader for a plugin (or a Cocoon block) will then "see" the classes exported by plugins/blocks the current one depends on. Thus, a plugin/block can export not only behavioural interfaces, but also classes that are part of the definition of the behavioural interface.


Just a note concerning the handling of this problem - in the Merlin container a block declares services that it exports. Based on this information the container (or a plugin) can verify that the context that the block services that are being included contain the classes required by the imported block. At the end of the day you have to make sure the APIs exposed by the imported block are included in the classloader of the importing block.

There is a on-line tutorial dealing with this sort of things at the following url:
http://avalon.apache.org/merlin/starting/advanced/composite.html


Ok, I've read it and am moving on to the rest of the merlin docs. These mention a lot of things like: "Content supporting this tutorial is available under the tutorials/composition directory" but I can't find that under viewcvs at least. Where are they?


The tutorials are under avalon/merlin/platform/tutorials.
http://cvs.apache.org/viewcvs.cgi/avalon/merlin/platform/tutorials/

You can also download the executable tutorials, docs, and distribution from:
http://www.apache.org/dist/avalon/merlin/binaries/

Stephen.



Geoff



--


Stephen J. McConnell
mailto:[EMAIL PROTECTED]





Reply via email to