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

推荐订阅源

Martin Fowler
Martin Fowler
D
DataBreaches.Net
F
Fortinet All Blogs
阮一峰的网络日志
阮一峰的网络日志
博客园_首页
Apple Machine Learning Research
Apple Machine Learning Research
H
Help Net Security
M
MIT News - Artificial intelligence
美团技术团队
人人都是产品经理
人人都是产品经理
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
The Cloudflare Blog
有赞技术团队
有赞技术团队
L
LangChain Blog
博客园 - Franky
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园 - 【当耐特】
S
SegmentFault 最新的问题
V
Visual Studio Blog
Blog — PlanetScale
Blog — PlanetScale
Hugging Face - Blog
Hugging Face - Blog
B
Blog
I
InfoQ

博客园 - 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