On Mar 12, 2009, at 1158AM, James Grahn wrote:
Seems like an improvement to me. Since Groovy objects and Java objects are equivalent in the JVM, does Groovy configuration also leave open the possibility of a pure Java approach if you desire that as well?
Sure, I think that shouldnt be a problem, you would just need to create an implementation of a Configuration that reflects on the loaded Java class(es) and obtains their declared and accessible properties.
The GroovyConfiguration class I wrote (in groovy) uses some of Groovy's meta method and class capabilities to make this easy. The big advantage to using Groovy here (IMO), is that the POGOs get loaded as scripts, no need to (pre-)compile them in the classes first. It makes the iterative process much easier.
If so, being able to pass in a Java object for initialization purposes for tests and dynamic loading would be another plus for this approach.
Wouldnt a groovy class file do the same thing?
