Vadim Gritsenko wrote:

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");


Good idea. But I'm not sure "summon" is a so common word (I had to look in a dictionary). What about the more traditional "createObject" or "instanciateObject"?

Sylvain

--
Sylvain Wallez                                  Anyware Technologies
http://www.apache.org/~sylvain           http://www.anyware-tech.com
{ XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }
Orixo, the opensource XML business alliance  -  http://www.orixo.com




Reply via email to