It is best to assume that the CFC has no direct access to any global
variables... Session, Application, Client, or even ones like Server.
Depending on the application or client calling your CFC, those listed above
may or may not exist. A good example is if you have a FLASH (through
flash-remoteing) calling your CFC. In such example, Session and client will
not persist, in addition to many of the server variables being unavailable.


Why is that a best assumption? My assumption is that most CFCs will not be used with Flash Remoting. Further, Java classes regularly make use of property files that contain their configuration, so the implication is that there doesn't seem to be a best practice in the Java world for not using external configuration files with classes.

The proper way to make a CFC is to pass in any variables that you might need
in the 'constructor'. I tend to use the 'make()' function as my
constructor, however I know the most popular way to name it is init().


I believe the proper way will depend on the circumstances. Further, I think any code that makes use of the pseudo-constructor area is likely to break in the long term when constructors are added to CFCs. Sure, Macromedia hasn't stated any plans along those lines, but they are going to have to add them plain and simple.

Matt Liotta
President & CEO
Montara Software, Inc.
http://www.MontaraSoftware.com
(888) 408-0900 x901


----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the word '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