The Mach-II Primer has a new home
A few weeks ago, Peter J Farrell from the Mach-II team asked if I would contribute the Mach-II Primer to the project's main Wiki. It took me about 30 seconds to agree.
A few weeks ago, Peter J Farrell from the Mach-II team asked if I would contribute the Mach-II Primer to the project's main Wiki. It took me about 30 seconds to agree.
A thread on the Mach-II Google Group about moving from Procedural style coding to Mach-II has been a great read. A recent post from Matt Woodward regarding ColdSpring (and too many visits to Ben Nadel's blog) inspired a new ad for ColdSpring.
We've seen how to convert data list and data detail pages from procedural code to Mach-II events. Now we need to refactor how we build form and action pages.
We last discussed how to manage recordsets with Mach-II. Now it's (finally) time to discuss how to work with individual records using Beans and Data Access Objects (DAOs).
Just when we thought we had conquered it, the VAR scope came back to haunt us.
Queries have been moved out of the View, but now object instantiation has been moved in. Using Implicit Invocation Listeners, we'll remove object instantiation from the View and reference objects and methods from the Controller (mach-ii.xml).
So far we've covered defining events and piecing together the user interface through the controller (mach-ii.xml). Now we need to move queries and business logic out of the View and into the Model. To get started, we'll move queries that return more than one record into Gateway objects using Coldfusion Components.
I'm hooked on those real estate shows where investors find old houses and fix them up. Once they've gone through the house and made plans, they rip out what they don't want or need, keep what they can reuse and then begin new construction. Using Mach-II, we can flip old Coldfusion code into modern, object-oriented applications.
Trying to output a variable that hasn't been defined will generate a Coldfusion error. When trying to output an argument from the event object that doesn't exist, the default returned value is an empty string. Understanding how, where and when event arguments are defined may be the most important part of learning Mach-II.
When you see a filename in a URL, you can go to that specific file on the server to see how the content displayed on the screen is put together. In Mach-II, the only filename you'll see is "index.cfm". In order to see how the content for a given URL is put together, you'll have to look into an event.

Subscribe in a reader | Subscribe by Email
ColdFusion Object Factory (ppt)
Copyright © 2001 - 2008 Adrian J. Moreno and i Know Kung Foo Consulting
BlogCFC was created by Raymond Camden. This blog is running version 5.9.001.