Chris Peters: Web Developer

Auto-documentation of your CFCs

Filed under: Programming — Chris Peters, October 26, 2006

ColdFusion Very few ColdFusion developers I know are aware that they can automatically generate documentation about their CFCs with little extra effort. If you use the hint attribute in your <cfcomponent>, <cfproperty>, <cffunction>, and <cfargument> tags, you can have ColdFusion generate helpful documentation. It’s very powerful and very effective.

Technorati Tags:
, , ,

In the real world: Image CFC

Rick Root, creator of the popular Image CFC, understands the value of the hint attribute. Because he used this attribute while implementing his CFC, he provides the opportunity for you quickly learn the API when you download the component. This makes me extra giddy!

Want to learn Image CFC quickly? Here’s all you have to do:

  1. Download the file.
  2. Place the CFC somewhere under your site’s web root.
  3. Call the CFC file from your browser. (Note: Placing CFCs not intended to be used as web services in your web root is not recommended for your production environment.)

Here is a copy of the HTML document that is generated by image.cfc. Easy to print and reference while you’re using the component in your own projects.

Be smart: use the attribute

If you don’t already work with at least one other developer, you never know when you may have to. Self-documenting your CFCs is yet another way to work better with other developers, with those who will have to maintain your code in the future, or to help you remember what the heck you wrote in your code years ago.

No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URL

Leave a comment