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.