>> Daniel Frey wrote:
>>
>>> Stephen McConnell wrote:
>>>
>>> Just a note concerning activation - the default behaviour is then any 
>>> component declared using <component> will have activation on startup 
>>> enabeld by default - unless the component type is transient.  
>>
>> Sounds like the default changes for all components in the system... This
>> is certainly true for WhateverImpl when using the activation attribute.
>> What about other components not using the activation attribute? Does the
>> default change for any component declaration within the same block.xml
>> (<container>), or even for any component running in the system? I would
>> expect that each component has its default which may be overridden by the
>> activation attribute for the component meant by the name attribute, so
>> in:
>> 
>> <container>
>>     <component name="fred" class="WhateverImpl" activation="startup"/>
>>     <component name="alf" class="WhatelseImpl"/>
>> </container>
>> 
>> That fred is activated on startup and alf is default.
>
> That's what happens.

Just correct me if I'm wrong:
- What about other components not using the activation attribute? They use
the unchanged default: transient.
- Does the default change for any component declaration within the same
block.xml (<container>), or even for any component running in the system?
Nop, neither.

>>> So for example, if WhateverImpl class contains a component tag looks
>>> like:
>>>
>>>  @avalon.component name="xyz"
>>>
>>> then the component will default to a "transient" lifestyle in which case

>>> activation on startup will be false - however, this can be overriden by 
>>> declaring the activation="startup" policy in the component directive.
>> 
>> So transient is default, which may be overridden in the component
>> configuration within block.xml 
>
> No.  The lifestyle of a component is declared by the component 
> implementation.  I.e. to use a different lifestyle you need to declare 
> this as part of the @avalon.component tag using the lifestyle attribute.

Ok. So transient is default activation. It may be overridden by in the
@avalon.component tag by using one of the values singleton, thread or
pooled. And this may be overridden by the components activation attribute in
the block.xml file.

Btw, I've found now three terms which in my limited beginners understanding
are equivalent: container <-> block <-> partition. If there is not
difference, except from where it is being used, it would be nice to unite
them. What about the very clear container.xml has a container tag and the
standard context entry for it is urn:avalon:container?

>> I suppose the lifestyle attribute of the avalon.component javadoc tag has
>> nothing to do with the activation?
>
> Given either of the following equivalent declarations:
>
>   @avalon.component name="widget"
>   @avalon.component name="widget" lifestyle="transient"
>
> The the lifestyle will be set to TRANSIENT and the default activation on 
> startup policy will be false.  For any other lifestyle, if the component 
> is actually declared in a block, the default activation on startup is 
> enabled.

So it has to do with each other: transient activation <- transient
lifestyle, startup activation <- singleton, thread or pooled lifestyle.
That's not mentioned in the javadoc tag reference in the Meta documentation.
Maybe you don't want to have too much cross referencing, which always
involves many documentation upgrades in case of changes... But if not I
could try to insert a subchapter "Note" mentioning this.

> Sorry about the problems - but the feedback is definely appreciated.

Don't sorry. That's normal, but confusing at the beginning. I think I'll
calculate two weeks of getting into Merlin before refactoring my
application.

Thanks,
Daniel


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

Reply via email to