I used to think the same myself, until my employer decided that we were
going to start deploying many of our applications over to PDA's (via flash)
along with mobile phones.  By using proper "C++ Class Style" programming on
CFC's (separation of globals, get/set methods, etc) you can defiantly make
your life easier in the long run.  As I started using CFC's this way, I
could make all three presentation layers, one logic layer and one data layer
(my DB), and everything works well together.  

-Nick Kwiatkowski

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf
Of Matt Liotta
Sent: Friday, September 26, 2003 12:46 PM
To: [EMAIL PROTECTED]
Subject: Re: [CFCDev] Top Ten Tips for Developing ColdFusion Components

> 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]

----------------------------------------------------------
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