> 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. 
 
This seems a bit hokey to me.  setServer, used as a getter, could confuse me and maybe other people. 
 
 > 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? 
 
I agree.  In the case of authentication, I would mimic CF's IsAuthenticated() method.  I would rather check a boolean than catch an exception.  However, there *could* be exceptions in actually *calling* the ldap query.  Of course, those should be thrown.
----------------------------------------------------------
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