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

Previous Topic Next Topic
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

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

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