John Rose schrieb:
> On Mar 10, 2009, at 5:25 PM, Jochen Theodorou wrote:
> 
>> so if there is a getMetaClass() method on the object which returns
>> groovy.lang.MetaClass and we inject an interface with an method of  
>> exact
>> the same signature, would we then get the implementation from the
>> interface or the one from the object?
> 
> You'd get the one already on the object.  No changing information  
> already specified.

I see.. so basically we cannot rely on that...

but back to the original problem... if I need to provide the methods and 
the interface, how do I get the hard link from the class to the meta 
class here? interface injection doesn't seem to allow me to add fields, 
only static ones on the interface of course. But that again would mean 
that we need one interface type per class. That will be a lot of 
classes. In some scenarios several thousand classes. And how is garbage 
collection done for these?

> If the object's class already had the interface, you wouldn't be able  
> to inject it a second time.
> 
> If the object's class already had a method (name/sig) of the  
> interface, you wouldn't be able to inject that particular method, just  
> the interface and its other methods (if any).
> 
> Like the rest of the JVM, this design is consistently monotonic in its  
> elaboration of class schema information.

I see... btw.. why does interface injection not bloat the object header? 
ah, well I think it is the class header then instead, which should be a 
lot less.

bye blackdrag

-- 
Jochen "blackdrag" Theodorou
The Groovy Project Tech Lead (http://groovy.codehaus.org)
http://blackdragsview.blogspot.com/


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "JVM 
Languages" group.
To post to this group, send email to jvm-languages@googlegroups.com
To unsubscribe from this group, send email to 
jvm-languages+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/jvm-languages?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to