On 10/7/08, Ricardo Araoz <[EMAIL PROTECTED]> wrote:

> I don't like stored procedures.

Me, neither. But there are lots of different kinds, with lots of
different capabilities and limitations, and sometimes you can do
wicked cool things with them. SQL Server is different from Oracle or
Ingres or DBCs or MySQL or Postgres.

> Why? Because you can not do 'everything' pertaining the data base with
> them. So you will end up with some of the code you use for your data in
> stored procedures and some of the code in your business layer. And I do
> not like that, I'd rather have everything in the same place.
> What do you think about this?

Assuming, since you flagged this as [NF] to mean that you're not
talking about FoxPro or DBCs or VFP Stored Procedures, as they're
quite different,...

Stored procedures are a great thing to do inside a database when
resource limitations (for example, bandwidth, even if gigabit
connections are available) make it impractical to move data or
processing off the server machine(s). However, stored procedures are
specific to each database (and in some cases, each version), so while
it can be a killer feature (a correlated subquery that drives a
parameterized crosstab on a couple tables with ten million rows of
data)

In large companies (those worried about SOX and HIPPA and other
acronyms), a stored procedure layer is often the only means offered to
the developer to access corporate data. The stored procedure interface
limits access, provides security restraints, allows auditing, and lets
the DBAs who own the database to make changes under the hood without
changing the API.

Data logic is best kept in a data layer or a data manager or a
Object-Relational Mapper (ORM). Sometimes logic has to be duplicated
between layers, where a business logic requirement may also be a
database restraint (for example, a non-null or non-zero field
requirement or a no-orphan, no-childless-parent requirement).

-- 
Ted Roche
Ted Roche & Associates, LLC
http://www.tedroche.com


_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/[EMAIL PROTECTED]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to