You are, of course, free to do whatever you like. But encapsulation has
a huge history of benefits and I'm afraid your opinion isn't going to
put the slightest dent in that history. 

In your example, I would argue that you should indeed be passing the CGI
variable into the CFC and not calling it directly. There's absolutely no
reason to do call it directly, the "cost" of passing it in is miniscule,
but the benefits of well-encapsulated code are thoroughly confirmed. The
same applies to calling request-scoped UDF's from within a CFC: it's
totally unnecessary. In fact, why are the UDF's in the request scope
anyway? I'd say, move them into an object and call them through the
object. If another CFC needs to use them, I'll pass in the object.

> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf
> Of John D Farrar
> Sent: Wednesday, September 29, 2004 6:28 PM
> To: [EMAIL PROTECTED]
> Subject: RE: [CFCDev] Function Libraries
> 
> Encapsulation debate rages like a cult blindness. There is good reason
for
> encapsulation... but if you follow that using request variables is
always
> bad (or functions) then you could never use a CGI variable inside a
CFC
> either... that would have to be passed it. (HEH!) Note... this isn't
aimed
> at you Dave... it's just a bad bill of goods to believe that this
virtue
> is
> universal. It is best "general" practice.
> 
> 1. If your CFC is designed to work in a Framework/Methodology ... like
> mine
> are, then this is less of an issue. It's like the CGI issue mentioned
> above.
> 
> 2. I declare an universal UDF library that has the udf to do standard
UDF
> library included. In "my case" the CFCs are designed to run inside my
> Framework/Methodology... therefore calling the library and running the
> UDFs
> in request scope is a GOOD design pattern. If you negate the
framework,
> then
> the other argument has more merit. Frameworks change the tenure of the
> discussion.
> 
> :) IMHO... heard the debates and my understanding is that inside a
> framework
> the rules are similar... but the implications are not.
> 
> John Farrar
> SOSensible
> 
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf
> Of David Ross
> Sent: Wednesday, September 29, 2004 4:27 PM
> To: [EMAIL PROTECTED]
> Subject: RE: [CFCDev] Function Libraries
> 
> but how do call these UDFs from within CFC's? If you are referencing
the
> request scope directly from your CFCs, that's a bad idea. If you are
> passing in the request-scoped udf lib when you instantiate your CFCs,
> then that's fine.
> 
> -Dave
> 
> ----------------------------------------------------------
> You are subscribed to cfcdev. To unsubscribe, send an email
> to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev'
> in the message of the email.
> 
> CFCDev is run by CFCZone (www.cfczone.org) and supported
> by Mindtool, Corporation (www.mindtool.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' 
in the message of the email.

CFCDev is run by CFCZone (www.cfczone.org) and supported
by Mindtool, Corporation (www.mindtool.com).

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

Reply via email to