jastrachan | 6 Apr 11:20 2004

Re: Properties

On 5 Apr 2004, at 20:32, Mike Spille wrote:
> For Groovy code, probably a warning or something similar could be 
> emitted to warn people about potential ambiguity.  For Java code where 
> people want to use the magic dot, then you're in for a rougher ride if 
> there' ambiguity.  The proposal here seems to be to use JavaBeans 
> rules to resolve ambiguity - but while some have said that using 
> JavaBeans is set in stone, I don't see why that has to be so.  The 
> magic dot is something brand new being used from a new language, and 
> does not necessarily match the originally envisioned JB usage 
> scenarios.  In the context of Groovy and the magic dot, an exact-match 
> may be a much saner approach overall and lead to far fewer surprises - 
> for the simple reason that many Java programmers don't know JavaBeans 
> conversion rules, most Groovy programmers probably also won't, and the 
> rules aren't always very intuitive in the magic dot context.

Agreed. The Groovy property resolution mechanism should be able to 
handle someone writing a non-JavaBean-compatible class. e.g. if you 
were to write multiple setters taking different types, we should be 
able to find & use the correct one. This incidentally should work today 
- if it doesn't then we should consider it a bug.