Details
-
Type: Wish
-
Status: Open
-
Priority: Minor
-
Resolution: Unresolved
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: None
-
Labels:None
-
Number of attachments :
Description
The problem:
Component lifecycle events are powerful but require either:
- Source code modification: ie an annotation or interface implementation.
- Source code consistency (ie the reflection lifecycle strategy that looks for stop start and dispose events.
What I would LIKE to do is be able to specify the lifecycle events in the nano config:
//Contrived Example:
container()
{ //Create a new Bar component that start ==s Bar.begin() //stop == Bar.finish() //and dispose == Bar.destroy() component(class:org.example.foo.Bar start:begin stop:finish dispose:destroy); }In XML Land, it would probably look something like:
<component stop="finish" start="begin" dispose="destroy" ....../>
Michael,
See how far you can get with writing a new LifecycleStrategy that either does begin/finish/destroy only or those and the default methods ...
.. and inject that in like so :-
container(new DefaultPicoContainer(new CustomLifecycleStrategy()))
{ component(class:org.example.foo.Foo); component(class:org.example.foo.Bar); }