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


[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to