There are those who put code in the pseudo-constructor area (outside of any function), but if you have an init(), shouldn't you move that particular block of code into the init() itself?
 
I would not hard-code any values in your CFLDAP query.  You will have more flexibility using variables.
 
You might also want to add the ability to loop over a list of ldap servers rather than just one.  This gives you some redundancy in case the first ldap query fails.
 
This looks like a very good start.  The only other thing I would change would how this is organized regarding CFLDAP and its use.
 
Your CFC is a security object, right?  However, you "insist" that the only authentication will take place using CFLDAP.  What happens if you want to authenticate from a database or some other directory?
 
You might want to have "authenticate.cfc" do only authentication and not worry about LDAP.  Then, have a separate ldap.cfc object that handles all/some LDAP interactions.  At that point, authenticate.cfc could call upon ldap.cfc to do the query.  If you move to another authentication scheme, you only need to change a single line of code in authenticate.cfc.
 
Please note my disclaimer.  I'm no OO guru like some on this list, but this is what I have learned in the last year or so.  I always made the mistake of having an object do "too much" and therfore, I lost flexibility.
 
M!ke


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Paul
Sent: Wednesday, March 30, 2005 4:09 PM
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