Alex Tkachman | 5 Aug 16:47

[groovy-dev] MetaClassRegistryChangeEvent

Do we really need to create new object for each event?
At the end of the day we have only too fields on it Class and MetaClass.
Wouldn't it be better to send them as parameters of call back?
The real reason of question is that if at some point we want
notifications for creation and annihilation of weakly referered meta
classes, which we will probably want at some point, then we create a
lot of work for collector with all these messages.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email

Jochen Theodorou | 5 Aug 17:19
Gravatar

Re: [groovy-dev] MetaClassRegistryChangeEvent

Alex Tkachman schrieb:
> Do we really need to create new object for each event?
> At the end of the day we have only too fields on it Class and MetaClass.

another question: does it hurt to do so?

> Wouldn't it be better to send them as parameters of call back?

well, I wanted it to be a bean based listener, so we can easily control 
it by using closures like I do in the test case. My requirement for 
creating a new object every time came, because I thought I have to 
subclass EventObject for the the event. Now I did reread the bean spec, 
and it seems I don't have to. But I am strongly encouraged. I am 
"allowed" to not to do that, if there is no other way only. I think that 
is not the case here. I also need to create a new Object each time, 
because the object needs to be immutable.

> The real reason of question is that if at some point we want
> notifications for creation and annihilation of weakly referered meta
> classes, which we will probably want at some point, then we create a
> lot of work for collector with all these messages.

do we want to? What kind of action would we do with this information? I 
mean given we use the current form, then we would get the Class and the 
MetaClass, were the MetaClass is null, because it has been collected 
already. What do we do with that information then? I would like to hear 
about that.... because currently I can't think of anything. You seem to 
have an idea? As for the creation I could imagine more, but nothing 
concrete atm... I wouldn't like to see call site's being registered at 
the registry. it won't work that way, because how will the listener and 
(Continue reading)


Gmane