[groovy-jsr] First cut at a new Meta Object Protocol

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[groovy-jsr] First cut at a new Meta Object Protocol

tugwilson
I have just committed experimental/groovy/lang/NewMetaClass.java to CVS.

This is an attempt to put some flesh on my proposal (on the jsr list)  
for a new MOP.

The important methods in this class are the abstract ones. If you are  
interested in the MOP or in using the MetaClass I would urge you to  
take a look at this.

Somebody implementing a custom MetaClass would need to implement all  
of the abstract methods. For people wanting to just hook one method  
or property access we would provide an updated version of  
DelegatingMetaClass which would mean that you had only one method to  
override .

The myriad concrete methods in the class are there to let me do some  
tests to see if we can improve the perfoamance of the MetaClass by  
letting the compiler use shortcut calls in common situations.

One general question to all:

We have getProperties and getAttibutes I'm a little puzzeld by the  
use of "attribute" I call these things fields. Anybody know why the  
MetaClass calls them attributes?


John Wilson
The Wilson Partnership
http://www.wilson.co.uk


Reply | Threaded
Open this post in threaded view
|

Re: [groovy-jsr] First cut at a new Meta Object Protocol

Jochen Theodorou
John Wilson schrieb:

> [...] Anybody know why the MetaClass calls them attributes?

no clue. I would say fields are correct.

bye blackdrag