• Horn Player – Computer Dude – Gig Pig …
  • Home
  • About
  • Blog
  • Services
  • Contact
  • Webmail
  • Terms

Robert A. Owen - Musician - Network Engineer - Support Master

Music, Technology, Rants and Funnies - Randomness at its best!

  • Blog
  • Internet
    • IIS 6
    • IIS 7.5
    • Javascript
    • Web Design
      • WordPress
      • Coldfusion
  • Support
    • MicroSoft
      • Powershell
      • Surface
      • Windows10
      • Zune
    • PC-Care
    • Software
    • Virus
      • Email Scam
    • Vista Quest
    • Windows 7
  • Pictures
    • Instagram
  • Music
  • Friday Funnies
  • General
    • CoWorking
    • Gadgets
    • Politico
    • Random – TidBit
    • Rant
    • Review
    • Site of the Week
    • Useless
    • Xbox
      • Games
You are here: Home / Coldfusion / Time to learn CFCs once and for all!

Time to learn CFCs once and for all!

September 15, 2008 By Robert Owen 3 Comments

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.

Related Posts Plugin for WordPress, Blogger...

Filed Under: Coldfusion Tagged With: cfc, Coldfusion, programming

Comments

  1. Doug McCaughan says

    May 19, 2009 at 5:55 am

    As you work with CFCs you’ll discover asynchronous gateways and that’s where ColdFusion really become fun! I like being able to hand something to a server and say, “get back to me with that.”

    I had a scrapper project once where the wholesaler would provide updated pricing and limited product information to a resellers via xml which was downloadable from a passworded administrative area but the xml file failed to contain product descriptions leaving the resellers the arduous chore of manually creating descriptions for new products and the impossible chore of recognizing which existing products had updated descriptions.

    The XML part was easy. A scheduled task ran nightly that used CFHTTP to log in and grab the XML file, it was processed updating prices, removing out-of-stock or retired products, and logged its results with CFLOG.

    The descriptions was more difficult. The database only had a couple thousand products but that was enough to timeout the connection when trying to loop over all the products and use CFHTTP to scrap the description from the manufacturer’s website. The solution was to have a scheduled task run weekly that launched a .cfm template. That template would read a certain number of products from the reseller database (which had been updated in the XML process) which I think was 500. Then with those ids it would call a CFC which was set up as an asynchronous gateway. The CFC would loop through that smaller number of ids and use CFHTTP to get product descriptions avoiding timeout issues and of course log its results with CFLOG. Since it is an asynchronous gateway, several batches of ids could be fetched at once, that is, ids 1-500 could be scrapped simultaneously with ids 501-1000 and 1001-1500…

    That was actually one of my favorite projects.

    Reply
  2. Doug McCaughan says

    May 19, 2009 at 11:19 am

    Wow! I didn’t realize that post was from Sept 08.

    Reply
    • Robert Owen says

      May 19, 2009 at 6:06 pm

      Yeah… I haven’t posted my update to that yet… “Things” keep getting in the way. Thanks for the info though!! 🙂

      Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Robert Owen A Horn Player turned salesman, turned Computer Consultant & Horn Player, Turn Network Engineer & Horn Player.... Well, How about a Horn player who does a lot of other stuff? More about me. FacebookGoogleLinkedInTwitter

To Stay up-to-date on all of my crazy Ramblings, enter your e-mail address below.

You'll be amazed!

Recent Posts…

  • Instagram Photos
  • Time for more Pictures
  • Windows 10 – Forget Wireless Network
  • Powershell to check and start a service
  • Its Amazing – Shia LaBeouf

Recent Comments

  • Sue K on Use the Snipping Tool to Capture MenusThanks you so much! I could never figure out how t…
  • aa on Increase IIS File Upload LimitsSuperb Robert..after wasting 2 days..this is perfe…
  • León on Windows 7 error 86Funciono para Windows 7 , también descubrí que la…
  • Nicole Larkin on Use the Snipping Tool to Capture MenusNine years later and your post is still helpful. T…
  • Federico on Windows 7 error 86Muchas Gracias!, que sería de los usuarios de Wind…

[footer_backtotop]

Content Copyright © 2021 OWEN CONSULTING · All Rights Reserved · Log in