CFGroovy is Self Executing

Tonight I finished porting the internals of CFGroovy from CFML to Groovy.  Yes, the CFGroovy core is now implemented in Groovy.  The remaining CFML code is for managing the public API (which is a CFML API and therefore must remain CFML),and for bootstrapping the Groovy core.

This architecture provides a number of benefits, primarily a huge reduction in the amount of crazy CFML-based Java interactions.  If you ever get to thinking that doing reflection with CFML wouldn't be too bad, you're wrong.  It's like pulling teeth with scissors.  That is not a typo or an inadvertant mixed metaphor.  The internal code is now far shorter and more readable, though there is still some nasty CFML in there.  Fortunately, I was able to get bootstrapping done with only no-arg constructors, so no more need to type-based constructor selection in CFML, thank god.

Moving the core down into Groovy also move one of my longer-term goals a bit closer to reasonableness.  I really want to create a persistence layer entirely in Groovy, manage it with an IoC container, and use it as a parent BeanFactory for a service layer (implemented with CFCs).  I tried a couple hacks to get this working with the 1.0 engine, and while both of them mostly worked, neither one worked all the way or was even remotely elegant.  Elegance isn't always possible, of course, but the lack of it is usually a red flag.  So I backed off until I had a better platform to approach it from.  But like I said, that goal is still a ways off.

5 responses to “CFGroovy is Self Executing”

  1. tara

    You are on fire Barney!! Great to see the work you are doing on CFGroovy.

  2. Henry Ho

    @tara, agree.

    @barneyb, what do you eat for breakfast? :)

  3. Pelle P

    Wouldn't it be possible to use GORM for persistence? With Grails 1.1, GORM can be used standalone and isn't dependent on Grails anymore. For more on GORM, se