Howdy,

I am just curious how you might handle optional instances vars in
components.  Lets say I have a dog cfc.  It always has a weight, but as my
dog (a welsh corgi) can attest he has no tail.  Therefore, a dog may or may
not have a tail.  Does that mean that I just have an empty instance var?
Here is how I would currently write it. Then if the arguments were
available, I would use the setters individually?  Is there a better way to
do it?  Thanks much!  ----Sorry for the short hand bellow.


<cfcomponent>
        <cfset variables.weight = "" />
        <cfset variables.tail = "" />

        <cffunction init>
                <cfargument name="weight"/>
                <cfset setWeight(arguments.weight) />
        </cffunction>

        <cffunction setWeight>
        </cffunction>

        <cffunction getWeight>
        </cffuction>

        <cffuction setTail>
        </cffuction>

        <cffuction getTail>
        </cffuction>

</cfcomponet>


Justin

P.S. Just in case you were wondering what a tail less dog looks like, here
you go!  THEDUKE! (Just so everyone knows, I did not cut his tail off.....he
came form the rescue that way.)

http://www.hossedia.com/desktops/duke_1024.jpg
----------------------------------------------------------
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