At 12:43 PM 6/2/2004, you wrote:
I prefer to create libraries of functions as CFCs - for example I've got a
"paths" CFC that contains 10 or so functions related to
system/relative/application paths.

An instance of that paths CFC then becomes a property of my Application CFC.

However the line is thin: as a functions container a CFC is no more complex
than a structure.  You could also create a "Paths" struct and store your
functions in that struct.

As I understand it, there is more overhead creating the instance of a CFC than using a straight "function".
What has your experience been with this?




A CFC has some abstraction benefits (which is the main reason I like them
for this).  For example in a CFC I've also got access to the THIS and
VARIABLES scope.  My Paths CFC, to continue the example, takes an
instantiation parameter which (when called from the application.cfm) sets a
public variable as "this.AppRoot".

It sounds like you are then using the CFC for more than just a function library.


In the end I'll say that if you're setting up the same functions for every
request (by CFINCLUDING or creating the CFC in the application.cfm every
request) then you're wasting cycles.  It's not much of a waste, but storing
common functions in a persistent scope will eliminate that small loss.

If you are doing this however then CFCs are definitely (very slightly)
slower - but it's nothing you'd ever notice.

I think you just answered my question above.


--
Jeffry Houser, Web Developer, Writer, Songwriter, Recording Engineer
<mailto:[EMAIL PROTECTED]>
--
AIM: Reboog711 | Phone: 1-203-379-0773
--
My Books: <http://www.instantcoldfusion.com>
Recording Music: <http://www.fcfstudios.com>
Original Energetic Acoustic Rock: <http://www.farcryfly.com>



----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev' in the message of the email.


CFCDev is run by CFCZone (www.cfczone.org) and supported
by Mindtool, Corporation (www.mindtool.com).

An archive of the CFCDev list is available at www.mail-archive.com/[EMAIL PROTECTED]

Reply via email to