Something that I've seen someone do was use a bit of trickery and allow the same function that gets the variable to set it, I thought it was quite neat.
 
Something like
 
<cffunction name="setServer" access="private" returntype="string">
      <cfargument name="newValue" required="false" type="string"> 
     
    <cfset var returnValue = "" />
     <cfif StructKeyExists(ARGUMENTS,newValue)> 
         <cfset variables.instance.server=arguments.newValue>
   <cfelse>
        <cfset returnValue = variables.instance.server> 
   </cfif>
    
    <cfreturn returnValue />
 </cffunction>
 
then call it either by not passing an attribute to get the value and passing an attribute to set it.
 
Also I was thinking, I dont know much about OOP but.. maybe you could return a boolean from the authenticate function, set some values inside the object and then write another function to retreive the detailed information if required?
 
Gareth.
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]On Behalf Of Paul
Sent: Thursday, 31 March 2005 8:09 AM
To: [email protected]
Subject: [CFCDev] cfc check

I’m about to begin a new project that will be my second attempt at “real” OO within ColdFusion.  (I’ve been working w/ CF since 4.5 but was unfortunately working with PHP when MX arrived on scene – been playing catch up lately.)   I learned a lot from my mistakes on the first app, and before I begin a new project I want to be sure my understanding of CFCs is at least fundamentally sound. 

 

For starters will you please review the attached CFC and point out any troublesome areas?  It is a simple LDAP authentication CFC, but I’d like feedback on the structure as a whole before I create many more similarly structured components. 

 

TIA

 

paul

 

----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email to [email protected] with the words 'unsubscribe cfcdev' as the subject of the email.

CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting (www.cfxhosting.com).

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

Reply via email to