Reactor still rocks

Once again, kudos to Doug Hughes on his excellent Reactor for ColdFusion project. I have been using Reactor for several months on a couple of projects I have been working on. I got the chance this week to whip together a small app at my day job and was once again amazed at how quickly one can develop a robust app in just a few hours when using Reactor. Reactor really takes the drudgery out of the coding process, allowing the developer to concentrate on the business needs and user interface for the project.

Model-Glue application walk-through

Once again Raymond Camden is putting every other ColdFusion developer to shame. He started a new blog series titled "Building your first Model-Glue application." It will be a step-by-step walk through of creating a Model-Glue app. If you've never used a ColdFusion framework (you're still writing spaghetti code, aren't you!), then this blog series may help you get introduced to the framework world. I have used Model Glue on one production website and have dabbled with it for a while now, and I think it is great, especially when combined with Doug's Reactor.

Reactor is Awesome!

I listened in on Doug Hughes' preso on Reactor at yesterday's Online ColdFusion Meetup Group. If you missed, visit the meetup site and listen in to the archived version.

<aside>I missed winning the ColdFusion 7 Standard Edition in the giveway by one person (random number selection from list of attendees) -- I was "sitting" right by the winner!</aside>

I had started using Reactor for my latest project while digging into ColdFusion OOP at the same time. The preso was quite good, but the best part was signing up for the Reactor mailing list afterward. I had a problem with the app I was creating when trying to join some tables to get all records--I didn't know how to use the Reactor objects to do the join and didn't know the "best practice" for doing it either. To make a long story short, you can create a function in the table's Gateway object (that is automagically created by Reactor) that create a Reactor query, joins tables, and can even set a where clause to grab the first record from a hasMany join. Here is an example of how to do that:

<cffunction name="getAllWithJoin" output="false" returntype="query">
<cfset var Query = createQuery() />
<!--- join all the associated tables --->
<cfset Query.join("Foo", "FooBar").join("Foo", "FooBee").join("Foo", "FooBoo")/>
<!--- only get first record from the table with the hasMany relationship --->
<cfset Query.getWhere().isEqual("FooBoo", "myField", 1) />
<!--- return the query --->
<cfreturn getByQuery(Query) />
</cffunction>

Easy as pie and database-independent too! Reactor is awesome--check it out!

BlogCFC was created by Raymond Camden. This blog is running version 5.8.