> This is where Sean and I were heading.  You have now found the need to
refactor your component into more than one.

OK so you've helped me see I need to separate the components, now I'm a bit
muddled on where to put things. Forgive me if this is hard to follow, my
brain is full.

Authenticate.cfc 
        authenticate() invokes ldap.authenticate(), returns boolean 
Ldap.cfc 
        authenticate() returns Boolean
        retrieveUser() returns query
user.cfc
        Unless I'm real confused, this is a user bean w/ getters/setters
userDAO.cfc
        read() - invokes ldap.retrieveUser(), returns user

My questions:

1. Should I rename authenticate.cfc to allow for additional functions like
checkPermissions() or is that kind of thing in yet another component?

2. Where should ldap.cfc live?  Ideally it would be someplace I could use it
from any other application on the server, right?

3. By pulling ldap functions into their own CFC, it's now possible for me to
authenticate against either ldap or mssql by passing a parameter to
authenticate().  Where would my sql functionality go?  Another CFC
specifically for SQL authentication?  Something more abstract than that?

Thanks for the help, based on the threads I browse on this list I'm sure
most of you are pretty bored by the simplicity of my questions but it's
quite useful hearing from you!

-Paul



-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf
Of Dawson, Michael
Sent: Thursday, March 31, 2005 7:45 AM
To: [email protected]
Subject: RE: [CFCDev] cfc check

>I actually already modified it to return a Boolean and was going to ask
- where would my retrieveUser function live?  If I have
authenticate.cfc, which I've modified to call cfldap.cfc instead of
tying LDAP to my authentication function, should retrieveUser be a part
of authenticate.cfc?

This is where Sean and I were heading.  You have now found the need to
refactor your component into more than one.

Authentication.cfc has no business retrieving data.  What happens if you
want to return data *after* you have already returned it once?  For
example, you need to refresh data that is stored in the session scope.
Does that mean you have to call authenticate's methods just to get the
data?  I hope not.  I would call a method from a CFC that is built just
for ldap queries.

It's great when things start to click isn't it?!

M!ke


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




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