jastrachan | 15 May 07:57 2004

Re: [groovy-dev] patch for Object.eachPropertyName()

On 14 May 2004, at 19:30, John Stump wrote:
> Sounds like a plan. I'll get to work on it. Also, if I
> understand the direction you're heading, should I replace the
> Map of PropertyDescriptor objects with a Map of MetaProperty
> objects?

You read my mind!

> It would be cool if we could clean up a lot of that code that
> pokes around in different locations looking for a property. The
> MetaProperty object could consolidate all that logic.

Agreed - that was my hope too.

> Also, what about dynamic beans? I haven't looked into the
> Expando class yet, but seems to me we can't cache a list of
> properties on these guys if they can change. Any ideas on
> handling this?

The Expando class will have to implement properties() itself to augment 
the metaClass.properties list with new dynamically created properties. 
The metaClass.properties will be shared across all instances of the 
Expando's class. (e.g. I could derive a Person class from Expando & add 
a few properties). Then at the instance level, expando's can add their 
own instance level properties.