In regards to query reuse, the CFMX7 Extensions enhancements are based on the fact that Dreamweaver is a WYSIWYG web editor for static and dynamic pages. Working with reused queries from ColdFusion shouldn't be an exception. Therefore, the goal was to retain every aspect of this best-practice visual and make sure everything is done right. I first cover the creation of the recordset; the embedded queries will have a name cfquery from now on.
To create a cfcquery, you must follow these steps:
Fill in the user interface as you would do for any regular recordset (see Figure 3).
Figure 3. Recordset dialog box with supplemental options
As you might have already noticed, there are some new things that must be taken into account: the Function pop-up menu and the New Function button:
The New Function button creates a new function in the active component; the only parameter required is the function name (see Figure 4).
Figure 4. New function dialog box
When you select a function from the pop-up menu, or a new one is defined, all parameters except the function name are automatically filled in with the following values:
This way you didn't have to remember any data source or table names, or write any code into a plain component file. All of this was done through the Dreamweaver visual interfaces. As you will see next, the code inside the component is standard cfquery code (see Figure 5).
Figure 5. Code generated by the CFC Recordset interface
This new visual approach reduces the recordset creation time and prevents code errors due to spelling mishaps in data sources or table names.
In this section you've learned what CFMX7 Extensions did in order to transform the cfcquery creation process into a simpler, visual process. In the next section you will find out what improvements CFMX7 Extensions brings when it comes to using them in your CFM pages.