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 11:54:02 GMT
Sylvain Wallez wrote:

> 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"?


Of course. "Summon" there was just for fun. createObject() will do just 
fine; instantiate is a bit worse (there are issues with the spelling ;-)

Vadim



Mime
View raw message