having "DB" CFCs that handle DB operations.
-----Original Message-----
From: Tom Kitta [mailto:[EMAIL PROTECTED]
Sent: Thursday, October 30, 2003 5:49 PM
To: CF-Talk
Subject: RE: CF treatment of queries inside CFCs
I forgot to say that this DB CFC extends another which is more general DB
library (contains server wide DB functions). Also in my CFC I have a number
of private functions that do common DB operations. I don't see any way that
I could leverage OO more, any suggestions?
TK
-----Original Message-----
From: Matt Liotta [mailto:[EMAIL PROTECTED]
Sent: Thursday, October 30, 2003 4:41 PM
To: CF-Talk
Subject: Re: CF treatment of queries inside CFCs
Sounds like you are using a CFC as a function library instead of as an
object. This isn't necessarily bad, but you don't get any benefits of
an OO design.
-Matt
On Thursday, October 30, 2003, at 04:04 PM, Tom Kitta wrote:
> Hello,
>
> I would like you guys to give me some feedback as to my recent
> programming
> practice. What do you think of it, how can it be improved etc.
>
> I decided to place all of my CF application database access into a
> single
> CFC, i.e. every query that the application ever uses is inside this
> cfc.
> There are only functions that implement queries in this CFC, it is
> called
> 'DBgateway'. I initialize this CFC in the application.cfm file if it
> is not
> already present, CFC is loaded into application scope with 2 day
> timeout.
> Each time I use a function from this CFC I execute some query (or a
> transaction). I don't lock calls to these functions since I don't
> think that
> a race condition is possible (I have though of many possible scenarios
> and I
> don't see any race condition possibility or dirty reads or anything
> like
> that).
>
> Inside the CFC there are about 100+ functions and the CFC is over
> 150kb in
> size. Each function encapsulates the query(s) with cftry block and if
> a DB
> error occurs another function (only function lucking a query within it
> in
> the whole CFC) generates debug e-mail that is sent to me. Each insert,
> update and delete operation is recorded to an audit table.
>
> I use cftransaction tag if more than one query has to be executed
> inside a
> function and queries depend on each other. For insert operations I
> always
> return inserted record id (zero on error).
>
> What do you think, good, bad or between? I don't really have anyone in
> the
> office to criticize me so I need to ask outside.
>
> TK
>
<image.tiff>
>
>
_____
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

