What is Scaffolding and how do I use it? - Part 1
You need scaffolding!
So you read something somewhere that said you should be using scaffolding and want to know how? Let me tell you a story.
ColdFusion has been developed to make creating applications easier right?
It certainly seemed that way when I downloaded it first. It was way easier that anything else available at the time. I first found out about it from a guy in bar. I was in San Francisco for the Web Innovations conference in December 1995. I told him what my customer wanted and how I was an expert in Visual Basic and was going to make web pages with it. He looked at me like with sorrow as slipped the paper with a single URL (www.allaire.com) into my hand. "You'll need some help!" he said.
I rapidly developed pages in CFML and they worked quickly and did a good job, but over time my applications got more complex and the pages more difficult to design. In fact I wasn't making pages anymore. I was making applications and they needed architecture. About that time Fusebox came to the rescue and that was great for a while, but them my applications got more complex. Then Fusebox evolved and grew and solved my problems. It even solved problems I didn't even know I had!
After a while CFMX came along and offered new features and a whole new world of OO was beckoning. That didn't seem to relate to my old fusebox world.
Then design patterns came and showed the way with DAO, Gateway and Services integrating into my old friend fusebox. Everyone told me this was best practice and after a lot of hard work the evidence was there. Applications really were easy to maintain. One of my customers changed their database overnight from the old one designed by me to a new one designed to accommodate a CRM system, but the architecture proved its worth. The changes were made on time and within budget.
While the new architecture is great for large applications it does seem difficult to get started. For a start there is lots of typing. I hate typing! Its boring typing. All those DAO s and Gateways and Services and Beans have to be built. The days of rapid development seem a long time ago.
Sometimes I long for that time long ago and those simple applications that didn't need an architecture. Occasionally I get tempted. It always turns out to be a mistake to give in. After a few days, one page has grown to ten, after a month it's running on three machines and has web services linking it to servers on three continents! I wake up at night screaming, dreaming, of the nightmare email asking for one small change to the simple, one page, application.
Scaffolder to the rescue.
The fusebox scaffolder is a code generator. It reads my database and creates code based on metadata in the database and some templates. I don't have to write the DAO and Gateway and Service and Bean any more. I create an index.cfm file and copy the 4 lines of scaffolder initialization code and the fusebox code into it. I change the datasource name to point at the database that is waiting for me and fire up the browser and wait. After a couple of minutes the application starts. All my code is there! A directory full of DAOs and Gateways and Services and Beans! No typing!
I am happy again. My customer is happy again. My nightmares are gone. Am I dreaming? When will I wake up? More to follow....



What kind of functions does the Fusebox Scaffolder put into the Service CFCs it generates?
Thanks!
p.s. - going to post this to the CFCDev mailing list as well just to have it on record there.