cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Eric SCHAEFFER" <eschaef...@posterconseil.com>
Subject Avalon explainations
Date Thu, 10 Aug 2000 08:28:51 GMT
Hi,

I work on FOP, and I'd like to make it Avalon aware. Can someone explain to
me how Avalon configuration framework should be used ?

I've got several questions:

1- Does the component manager should create a new instance of the requested
component on each getComponent() method call, or does it should only return
an already
created instance (during initialization) ?

2- What is the difference between Component and NamedComponent, which one to
choose and why ?

In fact, my problem is that, during the FO -> "internal representation"
process (layouting process), I need to use a factory class instance. This
factory instance is initialized by a configuration file, but it would be
stupid to create a new instance of this class each time I want to use it...

On the other hand, I understand that for a "parser" component, it would be
better that
getComponent() return a new instance...

3- If you want to give parameters to a component, you write, in the config
file, something like
<parameter name="..." value="..."/>
But if you want to give it a list of classes, without "names", what is the
"good" way of doing it ?

Ex.:
    ImageReaders are classes that read image headers, check if it is an
image type it can handle, and read the width and height of the image.

  <component role="image-reader-factory"
class="org.apache.fop.image.analyser.ImageReaderFactory">
    <image-reader class="org.apache.fop.image.analyser.GIFReader"/>
    <image-reader class="org.apache.fop.image.analyser.JPEGReader"/>
    <image-reader class="org.apache.fop.image.analyser.PNGReader"/>
    <image-reader class="org.apache.fop.image.analyser.BMPReader"/>
  </component>

This factory needs parameters, but it's just a list of classes, and not
named parameters.

Thank's,
Eric.



Mime
View raw message