By barneyb on May 14, 2009
It's been a couple months since I've done anything with CFGroovy. I've been mulling how to get back to the essence, which is Groovy scriptlets in CFML. Today at cf.objective() I put my fingers back on the keyboard for the first time. Here's a full implementation of the tag in 40 lines. There are [...]
Posted in cfml, groovy, tools
By barneyb on May 12, 2009
Just had a totally random thing happen with ColdSpring. I'm a big fan of the use-advice-as-advisor shortcut when you want to proxy every method on a bean. I use it all over the place. Tonight, however, it completely failed. No idea why. This app (PotD) has been running with the same version of ColdSpring for [...]
Posted in cfml
By barneyb on May 7, 2009
For the past month or so I've written more PHP than every other language combined. That's including English. Really. Four separate WordPress projects (two standalone, two MU), one of which is a blogging platform for Mentor Graphics, and I'm up to my neck. I'm a CFML developer by profession; I think I got off at [...]
Posted in cfml, personal, wordpress
By barneyb on April 14, 2009
I made a bunch of updates to CFGroovy tonight, mostly centered around two main objectives:
refocus on the original objective, inline Groovy scriptlets
support Open BlueDragon
The first objective is based on my experience developing the last couple apps I've used CFGroovy on. Hibernate is kickass, but neither of the apps used it; they only used CFGroovy for [...]
Posted in bluedragon, cfml, groovy
By barneyb on April 13, 2009
It's pretty common knowledge that ColdFusion passes arrays to UDF by value, and not by reference like pretty much every other language. It's a weird behaviour, but as long as you remember to write array-processing functions to be used like this:
<cfset myArray = modifyArray(myArray) />
instead of like this:
<cfset modifyArray(myArray) />
you'll be fine. However, someone pointed [...]
Posted in cfml, coldfusion, railo
By barneyb on April 7, 2009
Ben Nadel posted another interesting code snippet this moring. I think Ben and I stand in agreement on the technique: NEVER EVER USE IT. It leverages a horrible bug in ColdFusion's implementation of struct literals that I've blogged about previously.
Here's the snippet:
<cfset objConfig = {
root = getDirectoryFromPath(getCurrentTemplatePath()),
tags = objConfig.root & "tags/",
[...]
Posted in cfml, coldfusion, railo
By barneyb on March 25, 2009
While doing some regex stuff today I discovered that both ColdFusion and Railo use an external regular expression engine for the REReplace function instead of the one built into the core JRE (the java.util.regex.* classes). I don't think I've ever had a reason to care until now, but today I was stuck. Fortunately, since CFML [...]
Posted in cfml
By barneyb on March 24, 2009
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 [...]
Posted in cfml, groovy, tools
By barneyb on March 24, 2009
If you know anything about me, you probably know that I'm a big fan of Groovy. But why? I've never really addressed that question head on, I don't think, so I'm going to do that here (prompted by a comment from David McGuigan on my CFGroovy 1.0 post).
First, Groovy is a dynamic language for the [...]
Posted in cfml, groovy, tools
By barneyb on March 23, 2009
This afternoon I threw together a little blog demo app for CFGroovy. It's really simple, but it illustrates some more advanced usage. In particular:
The app uses ColdSpring to wire everything together and obtain transaction management with AOP, instead of having to code your transactions manually.
Entity relationships (as well as composition) with both direct and transient [...]
Posted in cfml, groovy, tools