ColdFusion Main > ColdFusion Articles > Coldfusion Components (CFC)
Coldfusion Components (CFC)
How do CFCs bring ColdFusion closer to OOP?
CFCs are not your normal function inclusion pages. When you create a CFC, you gain access to many more features than you would if you created an include page that contained a bunch of functions. They include:
• Security - you have the ability restrict access to your CFCs, and the methods within them, based on user roles and settings in your CF setup.
• Speed - CFCs are compiled so they execute faster. Keep this in mind when building your sites, as the first time a CFC is called, it is compiled and the output is returned; you might want to run through your site before releasing it to the public. Also remember that each time you make and upload a change to your code, the CFC will have to be recompiled -- but there's no need to worry, as the server handles all this for you.
• Extensibility - CFCs can be expanded upon and they can share methods with other CFCs, much like Java and PHP classes. CFCs can also be called externally using the SOAP protocol or URL calls, which allows you to make them available to other programmers and other languages.
• Reusability - If you code your CFC properly and are mindful of the implications of extensibility, your CFC can be shared and moved from server to server and script to script.
• Local Reusability - Once a CFC method is invoked on a page, it's typically reusable throughout that page. There are some exceptions to this rule of thumb, but the potential for code reuse means you don't have to call the function multiple times on the same page.
• Documentation - CFCs can generate their very own documentation using the hint attributes in the cfcomponent and cffunction tags. To see this functionality at work, simply open up a CFC in a Web browser (note that you will have to login with either a RDS or Administrator login to see the page). The server will generate a page that documents myCFC.
• Forward Thinking - CFCs represent the future for ColdFusion programming and development.
To Outsource Coldfusion e commerce, ColdFusion programming, ColdFusion CMS or any other kind of ColdFusion software, please contact us. We can make available Coldfusion Programmer or a team of Coldfusion Programmers and web debelopers for ColdFusion development and support.
For more details please visit our ColdFusion Services section.
Click here for more ColdFusion articles.