惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

云风的 BLOG
云风的 BLOG
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
IT之家
IT之家
Recent Announcements
Recent Announcements
B
Blog
D
Docker
V
V2EX
GbyAI
GbyAI
L
LangChain Blog
博客园 - Franky
U
Unit 42
T
The Blog of Author Tim Ferriss
A
About on SuperTechFans
博客园 - 【当耐特】
Google DeepMind News
Google DeepMind News
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Vercel News
Vercel News
博客园_首页
D
DataBreaches.Net
人人都是产品经理
人人都是产品经理
Y
Y Combinator Blog
量子位
Blog — PlanetScale
Blog — PlanetScale
罗磊的独立博客

博客园 - Jerry Qian

.net新技术书箱推荐 .net 操作excel的xml形式 wcf powershell type 一堂如何提高代码质量的培训课(转) powershell parse powershell basic powershell spirit .net国际化 转 MSBuild 简解 10-29 为什么linq以select开头 loadruuner 角本录制 test infopath 转log4net 配置 Service Broker 资料 sharepoint 安装 转 计算机端口介绍
怎样在存储过程及Sql语句之间选择
Jerry Qian · 2009-12-29 · via 博客园 - Jerry Qian

Consider the following guidelines when choosing between stored procedures and dynamic SQL:

1_1043131049
• If you have a small application that has a single client and few business rules, dynamic SQL is
often the best choice.
• If you have a larger application that has multiple clients, consider how you can achieve the
required abstraction. Decide where that abstraction should exist: at the database in the
form of stored procedures, or in the data layer of your application in the form of data access
patterns or O/RM products.
• If you want to minimize code changes when the database schema changes, consider using
stored procedures to provide an abstraction layer. Changes associated with normalization
or schema optimization will often have no affect on application code. If a schema change
does affect inputs and outputs in a procedure, application code is affected; however, the
changes are limited to clients of the stored procedure.
• Consider the resources you have for development of the application. If you do not have
resources that are intimately familiar with database programming, consider tools or
patterns that are more familiar to your development staff.
• Consider debugging support. Dynamic SQL is easier for application developers to debug.
• When considering dynamic SQL, you must understand the impact that changes to database
schemas will have on your application. As a result, you should implement an abstraction in
the data access layer to decouple business components from the generation of database
queries. Several patterns, such as Query Object and Repository, can be used to provide this
abstraction.
Application Architecture Guide 2.0a
Microsoft

martin flower

http://www.martinfowler.com/articles/dblogic.html