jastrachan | 5 Jul 10:48 2005
Picon

Re: adding dependency injection to groovy (was Re: [groovy-user] grails: Groovy class loader and Spring)

On 4 Jul 2005, at 16:08, Guillaume Laforge wrote:
>> [...]
>> I generally like to
>> a) avoid using keywords for different purposes
>> b) be sparse with keywords
>> c) keep the language as small as possible and let
>>    the library do as much as possible
>>
>> lookup could be DefaultGroovyMethod on Class
>>
>> def f = Cheese.class.lookup()
>>
>> or
>>
>> def f = Cheese.class.new()
>>
>> if you like that better.
>>
>
> Though initially I though reusing new, like we're redefining
> set/getProperty, or invokeMethod(), would be cool... but indeed, I'm
> now more inclined to prefer the approach you've just explained. I
> think that'd be less confusing to add a groovy method on class like
> lookup or new.

Yeah, I'm leaning to a static method now. So how about

def f = Cheese.new()

James
-------
http://radio.weblogs.com/0112098/


Gmane