Web Images Videos Maps News Shopping Gmail more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Group info
Members: 22
Language: English
Group categories:
Computers > Databases
Computers > Programming
Computers
More group info »
Recent pages and files
introduction-to-coldfusion-components    

Coldfusion Components also known as CFC?s. A lot of people I knowwho program Coldfusion and not use CFC?s have as excuse; it?s too hardto learn! It?s too hard to learn?? No way!!

It?s very easy tolearn. It?s just an other way of thinking than you?re used to. You mustsee CFC?s as building blocks. By constructing ?building blocks? you?recode is much cleaner and far more reusable, thus quicker to build yourapplication. Most (if not every) Coldfusion developer knows UDF?s (UserDefined Functions) and Custom Tags. CFC?s are almost the same as CustomTags, but have some differences:

  • Custom Tags have a singleentry point; CFC?s can have multiple entry points. This makes itpossible to create a single component that does many related actions.(To do that with custom tags you would need multiple tags or cumbersomeswitch processing.)
  • Custom Tags have no formalized parameterspassing and validation mechanism; CFC?s do. In other words unlikecustom tags, CFC?s can validate passed data, enforce data types, checkfor required parameters, and optionally assign default values.
  • CustomTags cannot persist; CFC?s can. Custom Tags are blocks of code that areexecuted as is, while CFC?s are objects and can be treated as such.
  • Custom Tags are designed to contain code; CFC?s are designed to contain both code and data.
  • CustomTags are accessible only by Coldfusion and only locally; CFC?s can beaccessed as web services, opening up a whole new world of reusepossibilities.

To sum it up, CFC?s and Custom Tags arequite different. Although their functionality does overlap a little,they really do not solve the same problems at all. So to learn thebasics of CFC?s while head right on it and start with some sample?spaghetti code? and transform it to a structured and reusable way; aCFC. Please note that this article only covers the basics of CFC?s anddoes not handle any advanced topics.

Introduction

ColdfusionComponents also known as CFC?s. A lot of people I know who programColdfusion and not use CFC?s have as excuse; it?s too hard to learn!It?s too hard to learn?? No way!!

It?s very easy to learn. It?sjust an other way of thinking than you?re used to. You must see CFC?sas building blocks. By constructing "building blocks" you?re code ismuch cleaner and far more reusable, thus quicker to build yourapplication. Most (if not every) Coldfusion developer knows UDF?s (UserDefined Functions) and Custom Tags. CFC?s are almost the same as CustomTags, but have some differences:

  • Custom Tags have a singleentry point; CFC?s can have multiple entry points. This makes itpossible to create a single component that does many related actions.(To do that with custom tags you would need multiple tags or cumbersomeswitch processing.)
  • Custom Tags have no formalized parameterspassing and validation mechanism; CFC?s do. In other words unlikecustom tags, CFC?s can validate passed data, enforce data types, checkfor required parameters, and optionally assign default values.
  • Custom Tags cannot persist; CFC?s can. Custom Tags are blocks of codethat are executed as is, while CFC?s are objects and can be treated assuch.
  • Custom Tags are designed to contain code; CFC?s are designed to contain both code and data.
  • Custom Tags are accessible only by Coldfusion and only locally; CFC?scan be accessed as web services, opening up a whole new world of reusepossibilities.

To sum it up, CFC?s and Custom Tags arequite different. Although their functionality does overlap a little,they really do not solve the same problems at all. So to learn thebasics of CFC?s while head right on it and start with some sample"spaghetti code" and transform it to a structured and reusable way; aCFC. Please note that this article only covers the basics of CFC?s anddoes not handle any advanced topics.

CFC benefits

Thereare a lot of benefits by using CFC?s. First of all you?ll separate the"business logic" (such as database queries, sending out emails and etc)from the "presentation layer" (displaying a user list or a productcatalogue). This will make the complete application much easier tomaintain and bring down development time. Also the benefit of codereuse is very big. By reusing existing code it?s much easier tomaintain your application, also the development time is brought down byreusing code.


READ MORE ... FULL ARTICLE HERE!!!

?

Version: 
Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google