the biggest hassle with SP's is that you are stuck with one set of SP
for a database

ie you can't tweak SP's like you can with normal queries

if you use bound sql, you can have two different builds with different
sql accessing the same db, with sp's
you can only have one.... a big hassle IMHO...

I agree with steve, all or nothing!

sp's making debugging harder

go the CFC approach, it's much more flexible

the performance difference isn't that big a deal again, SP's can be
seen as premature optimisation

z

On Mon, Jan 12, 2009 at 12:28 PM, Barry Beattie <[email protected]> wrote:
>
> I know ppl sometimes use databases for just basic data storage but
> business logic in a database is a very valid process, especially if
> inserts, updates and deletes involve triggers of related data.
>
> having said that, it's something I don't need to do all that often,
> and usually reserve for specialist uses. One problem is that (esp with
> triggers) the logic is somewhat hidden.
>
> but to be honest, the process should be abstracted anyway. something
> should "doSomething(data)" and how it's implemented shouldn't be cared
> by the calling code. Whether it's descrete SQL, a sproc or writing to
> a file.
>
> what that means is that you really need a data access layer and get
> away with SQL littered all through your code. _ALL_ SQL should be a
> specific layer of your code and everything calls what they need.
>
> : KISS - keep it simple
> : DRY - don't repeat yourself (ie: write code once and call it many times)
> two things to follow to make your life easier
>
> just my 2c.
> barry.b
>
>
>
>
>
>
>
> On Mon, Jan 12, 2009 at 11:19 AM, felixt <[email protected]> wrote:
>>
>> Hi all,
>>
>> It has been suggested by someone at work that we should only allow
>> access to database via stored procedures.
>>
>> This was proposed to fix the current situation where we have hundreds
>> of similar SQL statements scattered
>> around the system. For example if the business logic has changed in
>> one place that affects a table, one needs to do a keyword search on
>> all files to make sure all the related files are updated.
>>
>> I am aware of the benefits of going the stored procs way, like:
>> 1. Centralized place for logic
>> 2. Faster execution
>> 3. It's very unlikely that we will go with different database system
>> other than MSSQL so portability is not an issue for us.
>>
>> But I feel a bit uneasy about this, I don't feel business logic should
>> be in the database also I think debugging stored procedure will be
>> more difficult (adding one more place to check).
>> But this is just my feel, I might be wrong.
>>
>> Any thoughts, is this a normal/recommended practice? Also what are the
>> best practices that you guys use to combat this scattered SQL
>> statements?
>> I thought of using CFCs (gateways and/or DAOs) should be sufficient:
>> CFM -> CFC -> query
>> rather than:
>> CFM -> CFC -> stored proc
>>
>> Cheers,
>>
>> Felix
>> >
>>
>
> >
>



-- 
Zac Spitzer -
http://zacster.blogspot.com
+61 405 847 168

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"cfaussie" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/cfaussie?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to