Peter Donald wrote:

On Tue, 19 Nov 2002 13:47, Adam Rossi wrote:

what was
the typical avalon way of initializing component runtime values? The
lazy way, or the context method that you described, or something
different?

The context was the way Avalon was designed to provide the component with runtime values.
However some people would "blend" the runtime values in with the configuration/parameters objects. Think of it in a similar way to how ant operates. Consider an input xml fragment

<config>
<param key="name" value="some name"/>
<param key="time" value="${now}"/>
</config>

What people would do is expand the ${now} variable into the "now" runtime variable. So the component would end up being passed

<config>
<param key="name" value="some name"/>
<param key="time" value="14:03 Oct 20th 2002"/>
</config>

as part of configuration. This is one thing that a lot of people have requested we add in and there is current work underway to enable just that but until such infrstructure gets into place I would recomend you use the Context for runtime values.


Pete:

The ability to declare context creation criteria in XML has been available for a least 6 months. Significant enhancements to declarative context was introduced in the Merlin 2 work. For example, a component deployment profile (available today) could look like this:

<component type="MyComponent">

<context class="MyContextCLass">
<import name="avalon:home" key="base"/>
<entry key="location" value="Paris"/>
<entry key="special" class="MySpecialClass">
<parameter>%{base}</parameter>
<parameter class="java.lang.ClassLoader"/>
</entry>
</context>

</component>

This functionality comes as part of the work within the axcalibur/meta, excalibur/assembly packages.

Cheers, Steve.

--

Stephen J. McConnell

OSM SARL
digital products for a global economy
mailto:[EMAIL PROTECTED]
http://www.osm.net




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

Reply via email to