The "cfcomponent" tag (the "body" tag of the cfc file, I suppose) 
actually contains one or more "cffunction" tags; so your analogy to a 
regular function is close.

The cfc file itself can contain more than one function, so they are 
often grouped within, like a family of operations that you can do with a 
single "thing".

Those familiar with Java and "design patterns" will refer to cfc's as 
"objects", and the cffunctions within as "methods" that you perform on 
that object. With this collection of words you can probably Google 
around and learn more.

If you want to think of a method as something akin to a classic 
function, that's cool. But rather than passing in simple values and 
getting simple values back, you can call these methods using entire 
complex "other things" as the variables (like an image or a whole 
query). It's a nice way to wrap up a single business process (or single 
"model") into an encapsulated package that you can then use from 
multiple places, just like the simple function. Plus, you can "expose" 
them, so that other developers and businesses can call them remotely.

If/As you play with them more, you'll eventually see the differences 
between cfc's and custom tags or functions; and probably learn to 
embrace their value in your overall application strategy.

Alan K Holden

-- 
Open BlueDragon Public Mailing List
 http://www.openbluedragon.org/   http://twitter.com/OpenBlueDragon
 mailing list - http://groups.google.com/group/openbd?hl=en

 !! save a network - please trim replies before posting !!

Reply via email to