I think this is an old discussion, and that there's really no clear
winner.  Adrian was very clear that, in the end, he uses both
storedprocs and cfquery, and there's a lot of reasons to use both.


> Your biggest bottleneck in your application is going to be getting data to
> and from the database.

That's true, but I don't think it's often a bandwidth issue, but a
design issue on the database side.  People can move to storedprocs til
cows come home, but until people learn the value of constraints and
indexes, they're not going to help at much.

On the flip side, when a database is well-built, there's usually
almost no difference between using storedprocs and parameterized
queries (via cfQueryparam).

> But another reason is that if I decide to move languages from say ColdFusion
> to .NET I don't have to rewrite all of my queries again.

Again, I think it depends on the situation.  In your boat, having
things in storedprocs from get get-go would have been a godsend. 
However, if you had to redeploy to a new database engine...

> Those queries are then used over and over again throughout multiple
> applications. Instead of having one query written somewhere, they found it
> easier to rewrite the query.

I've seen the same thing happen with storedprocs:  a developer leaves,
a new one comes on board, needs to add a feature, doesn't know a proc
already exists to do something, writes "their" version...

> How many custom tags of queries are you going to have before
> it becomes unmanageable.

Even before CFCs came along, I'd wrap all of the basic types of query
on a table into a custom tag, letting me have a single file that
encapsulated most of the database operations for that
table/entity/concern.  With CFCs and the ability to employ common
persistence design patterns, this now becomes even more of a moot
point.  In fact, I have no idea if I'm running a <cfquery>, a
storedproc, or even making a Web Service call - I just know I have
something that gives me a query back.

My point isn't to be argumentative, but that to show that the choice
between using a storedproc and a <cfquery> isn't one that can be made
blindly, saying that you should always use one or the other.  It
depends on the context in which the decision is to be made.

-Joe


--
Get Glued!
The Model-Glue ColdFusion Framework
http://www.model-glue.com

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:228364
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to