没有合适的资源?快使用搜索试试~ 我知道了~
Designing Data Tier Components and Passing Data Through Tiers
需积分: 0 2 下载量 4 浏览量
2009-03-09
10:32:35
上传
评论
收藏 382KB PDF 举报
温馨提示
试读
70页
When designing a distributed application, you need to decide how to access and represent the business data associated with your application. This document provides guidance to help you choose the most appropriate way of exposing, persisting, and passing that data through the tiers of an application.
资源详情
资源评论
资源推荐
Designing Data Tier Components
and Passing Data Through Tiers
Information in this document, including URL and other Internet Web site
references, is subject to change without notice. Unless otherwise noted, the
example companies, organizations, products, domain names, e-mail addresses,
logos, people, places and events depicted herein are fictitious, and no association
with any real company, organization, product, domain name, e-mail address, logo,
person, place or event is intended or should be inferred. Complying with all
applicable copyright laws is the responsibility of the user. Without limiting the
rights under copyright, no part of this document may be reproduced, stored in
or introduced into a retrieval system, or transmitted in any form or by any means
(electronic, mechanical, photocopying, recording, or otherwise), or for any purpose,
without the express written permission of Microsoft Corporation.
Microsoft, SQL Server, and Windows are either registered trademarks or
trademarks of Microsoft Corporation in the United States and/or other countries.
© 2002 Microsoft Corporation. All rights reserved.
Version 1.0
The names of actual companies and products mentioned herein may be the
trademarks of their respective owners.
Collaborators: Luca Bolognese, Mike Pizzo, Keith Short, Martin Petersen-Frey (PSS),
Pablo De Grande, Bernard Chen (Sapient), Dimitris Georgakopoulos (Sapient),
Kenny Jones, Chris Brooks, Lance Hendrix, Chris Schoon, and Franco Ceruti (VBNext).
Contents
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Data Access Logic Components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
Representing Business Entities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Technical Considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
Mapping Relational Data to Business Entities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
Recommendations for Mapping Relational Data to Business Entities. . . . . . . . . . . . . 8
Implementing Data Access Logic Components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Application Scenarios for Data Access Logic Components . . . . . . . . . . . . . . . . . . . . . 9
Implementing Data Access Logic Component Classes . . . . . . . . . . . . . . . . . . . . . . 11
Using Stored Procedures in Conjunction with Data Access Logic Components . . . . . 14
Managing Locking and Concurrency . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
COM Interoperability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Implementing Business Entities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Representing Business Entities as XML . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
Representing Business Entities As a Generic DataSet . . . . . . . . . . . . . . . . . . . . . . 25
Representing Business Entities As a Typed DataSet . . . . . . . . . . . . . . . . . . . . . . . . 28
Defining Custom Business Entity Components . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
Defining Custom Business Entity Components with CRUD Behaviors . . . . . . . . . . . . 34
Recommendations for Representing Data and Passing Data
Through Tiers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
Transactions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
Implementing Transactions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
Recommendations for Using Manual Transactions in Data Access
Logic Components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
Recommendations for Using Automatic Transactions in Data Access
Logic Components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
Using Automatic Transactions in Business Entity Components . . . . . . . . . . . . . . . . 40
Validations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
How to Validate XML by Using an XSD Schema . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
How to Validate Data in Property Accessors in Business Entity Components . . . . . . 42
Exception Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
Recommendations for Managing Exceptions in a Data Access Logic Component . . . 43
Recommendations for Managing Exceptions in Business Entity Components . . . . . . 44
Authorization and Security . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
Recommendations for Security in Data Access Logic Components . . . . . . . . . . . . . 45
Recommendations for Security in Business Entity Components . . . . . . . . . . . . . . . . 48
Deployment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
Deploying Data Access Logic Components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
Deploying Business Entities. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
Contentsiv
Appendix. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
Appendix Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
How to Define a Data Access Logic Component Class . . . . . . . . . . . . . . . . . . . . . . 50
How to Use XML to Represent Collections and Hierarchies of Data . . . . . . . . . . . . . 51
How to Apply a Style Sheet Programmatically in a .NET Application . . . . . . . . . . . . . 52
How to Create a Typed DataSet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
How to Define a Business Entity Component . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
How to Represent Collections and Hierarchies of Data in a Business
Entity Component . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
How to Bind Business Entity Components to User-Interface Controls . . . . . . . . . . . . 57
How to Expose Events in a Business Entity Component . . . . . . . . . . . . . . . . . . . . . 58
How to Serialize Business Entity Components to XML Format . . . . . . . . . . . . . . . . . 60
How to Serialize Business Entity Components to SOAP Format . . . . . . . . . . . . . . . . 64
How to Serialize Business Entity Components to Binary Format. . . . . . . . . . . . . . . . 65
Introduction
When designing a distributed application, you need to decide how to access and
represent the business data associated with your application. This document pro-
vides guidance to help you choose the most appropriate way of exposing, persist-
ing, and passing that data through the tiers of an application.
Figure 1 depicts the common tiers of a distributed application. This document
distinguishes between business data and the business processes that use the data;
the business process tier is discussed only where needed for clarification. Likewise,
the presentation tier is discussed only where there are direct implications for the
way data is represented, such as the way ASP.NET Web pages expose business data.
Figure 1 introduces two new terms: data access logic components and business
entity components. These terms are described later in this document.
Presentation Tier
Presentation
Tier
Business
Process
Components
Data Access Logic
Components
Business
Entities
Application Data
Business Process Tier
Data Tier
Figure 1
Accessing and representing data in a distributed application
剩余69页未读,继续阅读
KelvinYuan
- 粉丝: 0
- 资源: 4
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0