I’ve been putting this off for a while. I’m not sure why, maybe it was just laziness. Anyway, I feel it’s time to buckle down and finally learn to create and use CFCs correctly… You know, to unleash the power, so to speak.
Ok, I know now you are thinking I’m talking about chlorofluorocarbons (CFCs) but I’m not. What I actually am trying to get a firm grasp on are ColdFusion Components (CFCs). What are these, you ask?
From the Coldfusion Live Docs
A ColdFusion component (CFC) is a file saved with the extension .cfc. A CFC can contain data and functions. Within a CFC, data is referred to as properties. Although you use the cffunction tag to define functions within a CFC, they are typically referred to as methods instead of functions.
The page on which you define a CFC is also known as a component page. Component pages use the same tags and functions that regular CFML pages do, plus a small number of special tags (in particular, the cfcomponent tag) and tag attributes.
You define related methods in a CFC. Unlike ColdFusion custom tags, a single CFC can perform many related actions, defined in multiple methods. The methods may share a data context, such as metadata and scoping, or manage a particular database or set of tables. For example, you can define the methods to insert, update, delete, and retrieve records from a particular database or table in one CFC.
So there ya go. Sounds fun and useful, right? Well, thus continues my quest at bettering my Coldfusion knowledge and hopefully taking one more step forward in my Coldfusion Jedi Training. Because we all aspire to be like the master. Tomorrow, I hope to have, for your approval of course, my first CFC.
© 2008 – 2009, Robert Owen. All rights reserved.