on the matter of SProcs: for me it's not just performance.

I worry every time I code in names of db fields and tables within a web
page. It adds tighter coupling between two systems - the webserver and the
data store - and makes the code dependant on any changes in the db. Change a
field name and the code breaks. 

one of the reasons I used rs.getrows() (return results in 2D arrays) and
SProcs in ASP was to create loose coupling between them and have code reuse.
Throw the connection object any valid command string (a Sproc name + param
values) and get back a 2D array. Even if it was a 1 row/1 cell result like
"SELECT @@IDENTITY". 

no hard coded field names to use. no need to be bound as in
#qResults.fieldName# or <cfprocparam dbVarName = "@fieldName">

maybe it's old fashioned but I just reckon it's better to make things as
generic as possible than writing reams of specific db connection code. Yeah
I know ASP.NET datasets use this tight coupling now-a-days (and even has
"typed" datasets - which makes me real uneasy - it's like bloody DAO!), it's
just the way I was taught.

Here's a thought. I almost fainted when this worked:

   <cfquery name="qLogin" datasource="gallery">
        exec qsp_login '#Form.userid#', '#Form.password#'
   </cfquery> 

got change for 2c?
cheers
barry.b
  

-----Original Message-----
From: Mark M [mailto:[EMAIL PROTECTED]
Sent: Thursday, 31 July 2003 11:13 AM
To: CFAussie Mailing List
Subject: [cfaussie] Re: best practices - any of these apply to CF?


> Just to add to what Tim said ;) -- you can't use dynamic query
> cacheing 
> if you use CFQUERYPARAMs  So you need to make that decision up front 
> before you implement either.

Just to throw my 2c in here as well - 

I wouldn't have thought dynamic query caching would be a deal breaker - 
considering the number of ways CF allows you to set up your own caching 
models... application scope, wddx files etc etc etc, without having to rely
of the 
cfquery/cache.

Personally - I would say - used stored procs for most things. Use cfquery
for 
interesting dynamic sql, and if you want caching from those, spend 10
minutes 
and write your own.

But thats Just my Opinion ;o)

Mark

-----------------------------------
[EMAIL PROTECTED]       
ICQ: 3094740
Safe From Bees
[www.safefrombees.com]

---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to
[EMAIL PROTECTED]

MX Downunder AsiaPac DevCon - http://mxdu.com/

---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]

MX Downunder AsiaPac DevCon - http://mxdu.com/

Reply via email to