cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vadim Gritsenko <vadim.gritse...@verizon.net>
Subject Re: Introducing IOC for Java classes created in flowscript
Date Fri, 21 Nov 2003 03:10:08 GMT
Sylvain Wallez wrote:
.....

> So I added a new method to "cocoon" that sets up an object just as if 
> it were an Avalon component by honoring the various lifecycle interfaces.
>
> Some useful lifecycle interfaces to implement are of course LogEnabled 
> and Serviceable, but also Contextualizable, which gives access to the 
> object model through the ContextHelper class.
>
> Example:
>  var foo = new Foo();
>  cocoon.setupObject(foo);
>  foo.doIt("blah");
>
> This way of setting up object respects IOC, avoids using the very 
> specific "FOM_Cocoon" class and gently educates people to the good 
> things provided by Avalon.


To make it even more avalonish, this method should instantiate object as 
well. So it will become:

    var foo = cocoon.summonObject("com.mycompany.Foo");


Vadim



Mime
View raw message