G'day mate, a couple of questions:
How come you're having numeric args specified as "string"? Isn't it
better to have them specified *as* numeric, and let CF handle the
"incorrect data type" error? It also makes for better (ie: more
accurate) component-browser auto-documentation.
Also, in yout init() function, those arguments are not really optional.
I'd make them required, and get rid of the meaningless default data. To
me, a default value should be one that actually *works* (eg: the default
of comma as the delimiter in list functions, and such like).
One thing I like is your approach here:
<cfif not ReFindNoCase("(^Base$)|(^OneLevel$)|(^SubTree$)",
Arguments.Scope)>
That's never occurred to me, I've alsways done something like this:
<cfif not listFindNoCase("Base,OneLevel,SubTree", Arguments.Scope)>
But using REs give one a more flexible approach. Cool!
(oh, there's a couple of typos in your error messages: "agrument" ;-)
Adam
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Dawson, Michael
Sent: Monday, 11 August 2003 4:26 a.m.
To: [EMAIL PROTECTED]
Subject: Active Directory Query Service was: RE: [CFCDev] Component
Critique Wanted
Here is my almost-ready-for-production cut of the component. I'm pretty
satisfied with this code. I have enough flexibility with the methods,
yet still retain many default values, in the init() method, that I don't
normally touch.
I do have to give a lot of thanks to the "power contributors" of this
list. I have learned quite a bit about CFCs and OOP (as it applies to
CFMX) from lurking here.
Is this of the caliber to post on the cfczone or cflib sites? I haven't
seen too many, if any, functions that handle LDAP queries. Do all udfs
on cflib need to be built with cfscript only or will they also accept
tag-based udfs?
Thanks
-----Original Message-----
From: Nathan Dintenfass [mailto:[EMAIL PROTECTED]
Sent: Saturday, August 09, 2003 8:07 PM
To: [EMAIL PROTECTED]
Subject: RE: [CFCDev] Component Critique Wanted
Looks good.
One thing to consider for making it more flexible would be building an
init() method that takes a list (or array) of servers and that login
info, etc. and stores that as an instance variable (perhaps even using
an
addServer() method). That way this component will be abstracted from
the specifics of your environment. You could then loop through the
servers passed in, which would tighten up the code a bit.
The only other comment is that you seem to use the Arguments. prefix on
all your arguments except sortOrder.
I'd also think that it might be nice to have a default SortOrder and
Separator rather than needing to pass those in every time.
----------------------------------------------------------
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).