Joe Rinehart on Architectural Relationships Between Model-Glue and Cairngorm

Joe has posted a nice diagram that shows how the pieces of a Model-Glue application relate to the pieces of a Cairngorm application. As someone trying to learn Cairngorm, this is pretty useful. To be honest, from a noob perspective, Cairngrom seems to have a lot of layers and a lot of code, and I was unsure of what the actual point to these layers are. This diagram helped clear up some of the confusion.

Comments Comments (2) | | Digg It! Digg It! | Linking Blogs Linking Blogs | 6295 Views

Get Model-Glue Training, With ColdSpring, Transfer and Reactor Too

Just a quick note that Doug recently posted about a sweet price decrease for his first Model-Glue training class. Setting up a training business is difficult so the price drop doesn't surprise me at all. You really need to build up a base of happy students who spread the word, and in the beginning that means you need appealing pricing.

Well, this is good news for anyone interested in building their ColdFusion skill set. Not only will you get a good dose of Model-Glue, from the basics on up, but there are course sections on CFCUnit, ColdSpring, Transfer, and Reactor as well. Given the number of questions on various lists and blogs about MVC, dependency injection, object-relational mapping, and general object-oriented programming concepts, this seems like a great way to get your head around a lot of topics quickly and efficiently. Just because some of us long-time CF'ers had to beat our heads against he wall trying to learn things doesn't mean you have to! (I could also tell you about walking to school in the snow uphill both ways...)

Anyway, the upshot is that anyone in the midst of trying to learn these things should definitely have a look at the class. $800 is just really darn cheap, and I wouldn't expect it to stay at that kind of price point for very long. Get in while the getting is good.

Comments Comments (2) | | Digg It! Digg It! | Linking Blogs Linking Blogs | 6157 Views

Using ANT and ColdFusion to Emulate Rails Generators

One of the nice things about Rails is how it can automatically spit out common code for you. For example, if you need a new Model or Controller, Rails can spit one out for you, ready to be customized, with one line of code.

I've thought for a while that similar capabilities could be obtained using Apache ANT, which comes built in to Eclipse or can be downloaded separately and run from the command prompt. Last night I had a few minutes so I decided to try it for fun. And it seems to work pretty well!

For example, in a Model-Glue app, I could execute an ANT task called create_controller.xml. What this would do is prompt me for the name of the controller. Say I enter "StoreController". Then it copies the Controller from the Model-Glue application template folder into my application's controller folder and names it StoreController.cfc. Then it embeds new XML into the Model-Glue config XML file like:

<controller name="StoreController" type="deli.controller.Controller">
	<message-listener message="OnRequestStart" function="OnRequestStart" />
	<message-listener message="OnQueueComplete" function="OnQueueComplete" />
	<message-listener message="OnRequestEnd" function="OnRequestEnd" />

into the controllers block. It does this by doing some replace commands on the Model-Glue XML, as well as replacing the controller name and the application name. It does the same sort of replace within the CFC to embed the proper name and path.

I also did this with a create_event.xml file. This prompts me for the name of the event, and a view file name, and then creates the XML for the event, copies a view template into my views folder, and name it to match the view file name I specified.

If you've used the Model-Glue application template to create a new application, you know it already does some copying of files and some replacing. It wouldn't be hard to imagine it also copying and creating a set of build XML files to perform common tasks like this. These build XML files would all be set up specific to the newly generated app, with the proper paths and application name already embedded within them. And obviously the same sort of thing could be done with any framework (ColdBox, Fusebox, Mach-II, etc.)

These two examples were quite simple to create. And while they don't save a huge amount of time, it does save some time. I don't have to worry about creating new view or controller stub files, or creating the base XML in the config file. The build XML will do this for me in about one second. I could imagine making these do much more complex things if necessary, since ANT has a very large set of tasks that it can perform, including RegEx processing and replacement.

I was curious to see if anyone had thought about something like this before, and if this sounds like it would be useful.

Comments Comments (7) | | Digg It! Digg It! | Linking Blogs Linking Blogs | 7520 Views

The Bookstore App Meets ColdFusion 8 (aka Operation: AJAX)

I've been playing with the new AJAX capabilities in ColdFusion 8, and I'm impressed. They've really made it easy to add AJAX functionality to an application. As a personal experiment, I decided to try converting an existing page-based app into a single-page, AJAX-driven one. So as usual, I brushed the dust off of my tried-and-true sample bookstore application and went to town.

Some of you might have seen the bookstore app before; I've had it on my site for quite a long time. It's gone through Fusebox 3, FuseQ, Fusebox 4, Fusebox 5, Mach-II, and Model-Glue:Unity versions. It was also the basis for my "Framework-Agnostic Models" presentation at this year's Frameworks Conference.

I was quite stunned to find that converting the Fusebox 5 version into an AJAX application took about 2 hours. Yes, 2 hours. Part of the reason it was straightforward was that the app already leveraged self-contained content blocks for each page element. Basically, each of the sidebar elements, the main page content, and the menu are all CFDIV blocks now. Each one updates on its own, asynchronously, using the built-in AJAX goodies in CF8.

It was interesting to see how my development approach had to change to support a more event-driven GUI. Each link or form is tied to a JavaScript event handler that determines which content elements to update via AJAX. I can see now how doing complex GUI programming is a real challenge, because this was only 8 or 10 events. I think I have some learning to do when it comes to patterns that apply more to GUI development than the patterns I'm used to dealing with in the model.

In any event, I've added this AJAX-ified version of the bookstore to the Framework-Agnositc Models Code and Presentation .zip file in the right sidebar. If anyone is interested in having a look, please do and let me know what you think.

Comments Comments (2) | | Digg It! Digg It! | Linking Blogs Linking Blogs | 7399 Views

Model-Glue:Unity = Wicked

I had the chance to play with the Alpha, then the Beta, and watched Joe's presentation on Model-Glue:Unity yesterday. All I can say is this kicks ass. A stunning example of what happens when a sharp guy with vision combines three great frameworks together and creates something amazing. I liked his discussion of what he called (I believe) "2nd generation" and "3rd generation" frameworks, where the 2nd generation helps you eliminate duplication at the file level, but the 3rd generation helps you eliminate duplication at the process level (for example, handling CRUD for ALL of your tables in an abstracted way). I won't go into more detail because there are already some other blog posts that cover this. Suffice to say that I continue to be floored by what the CF community is pumping out nowadays. Fusebox 5, Reactor, ColdSpring...this stuff is just getting ridiculously awesome. :-)

Comments Comments (1) | | Digg It! Digg It! | Linking Blogs Linking Blogs | 5737 Views

More Entries