Advanced CFC Topics

I mentioned several advanced CFC topics briefly earlier in this chapter. These topics included introspection, inheritance, CFC security, and assigning component instances to shared variable scopes. This section presents a more detailed exploration of each of these topics.

Introspection

One of the coolest features of CFCs is that they are self-documenting. All of the various tag attributes we discussed throughout the chapter, along with any user-defined attributes, are available as component metadata. This metadata exists as a ColdFusion structure that can be used for all sorts of purposes. ColdFusion MX comes with a tool called the CFC Explorer that you can use to introspect any CFC on your ColdFusion server. To use the CFC Explorer, simply fire up a browser and enter the URL to the CFC you want to introspect. You should be presented with the CFC Explorer login screen shown in Figure 22-3.

ColdFusion Administrator RDS password prompt for accessing the CFC Explorer

Figure 22-3. ColdFusion Administrator RDS password prompt for accessing the CFC Explorer

You’ll need to enter the RDS password for the server to use the CFC browser Once you’ve entered a valid RDS password, ColdFusion MX allows you to proceed to the CFC Explorer. The CFC Explorer displays a nicely formatted screen containing the component’s metadata, including the component’s name, path on the server, properties, and methods. A sample CFC Explorer screen is shown in Figure 22-4 ...

Get Programming ColdFusion MX, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.