Hamilton Verissimo de Oliveira (Engenharia - SPO) wrote:
-----Mensagem original-----
De: Stephen McConnell [mailto:[EMAIL PROTECTED]


Basically a lifestyle handler encapsulates the decision concerning when a new instance is required. In the activation package you will find a LifestyleManager interface, a set of implementations, and a LifestyleManager factory. The factory is supplied with a ComponentFactory which deals with the setup and tearddown of components. What I think you describing in Avalon4ComponentHandler looks to me like an implementation of a component factory.


Instantiation *is* a lifecycle phase. If you don't, you would need a
different componentfactory to handle Avalon - a very simple one - and a huge
one to pico.

In the activation architecture the complete component deployment sequence is handled in the ComponentFactory. If you want to establish a new A4 component instance (meaning object instantiation + all relevant lifecycle stages) you invoke factory.incarnate() and you get back the full established object - lifecycle stages and all of that stuff are totally encapsulated in the factory. If want to deal with A5 component establishment - no problem - just use an A5 factory - without changing lifestyle semantics of implementation.


Keep in mind that the only object in the entire system that needs to create new components in the LifestyleManager.



Second point - I think its a bad ide to use interface such as Serviceable etc. to provide a ServiceManager to a factory when in fact the factory isn't using the manager to resolve a dependency


Agree. But I think its just a matter of simplest things first.

Yep.


Cheers, Steve.

--

|------------------------------------------------|
| Magic by Merlin                                |
| Production by Avalon                           |
|                                                |
| http://avalon.apache.org/merlin                |
| http://dpml.net/merlin/distributions/latest    |
|------------------------------------------------|

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



Reply via email to