On Thursday 05 February 2004 18:34, Yura Ivanov wrote: > <container name="tutorial"> > <component name="hello" class="tutorial.HelloComponent"/> <!-- just > component nothing about service which it supported --> <component > name="second" class="tutorial.SecondComponent"/> <!-- another component > and suppose it supports the same service but I cann't say it when I read > this config --> </container>
Merlin will pick the "type descriptor", i.e. the "tutorial/HelloComponent.xinfo" file and read the Services it provides there. > So I think that in this way block.xml > would be more descriptive for an application structure. You can do a lot of things in the block.xml already, which you in time will appreciate. The fact that "type" is read from the "type descriptor" is a good thing. And if you use the meta-plugin, it will generate the .xinfo files properly, without you bothering... You just add @avalon.service type="tutorial.Hello" in the component implementation's javadoc section for the class. You can either rely on Merlin's automatic assembly feature, where it will automatically connect a "key" in the lookup() with an implementation of the service that the key is referring to. BUT, you can also manually connect a particular implementation to such key, or having many instances of the component with different Configurations connected to the key. I hope this shed some light... Cheers Niclas --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
