您好,欢迎光临本网站![请登录][注册会员]  
文件名称: Smart Client Architecture
  所属分类: C#
  开发工具:
  文件大小: 4mb
  下载次数: 0
  上传时间: 2008-05-26
  提 供 者: Johns******
 详细说明: Contents
Foreword vii
Chapter 1
Introduction 1
What Is a Smart Client? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Rich Client Applications. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
Thin Client Applications. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
Smart Client Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Types of Smart Clients . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Windows Smart Client Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
Office Smart Client Applications. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
Mobile Smart Client Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Choosing Between Smart Clients and Thin Clients . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Smart Client Architectural Challenges . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Scope of This Guide . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
How to Use This Guide . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Who Should Read This Guide. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
Prerequisites . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
Chapter Outlines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
Chapter 1: Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
Chapter 2: Handling Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
Chapter 3: Getting Connected . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
Chapter 4: Occasionally Connected Smart Clients . . . . . . . . . . . . . . . . . . . . . . . . . 15
Chapter 5: Security Considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
Chapter 6: Using Multiple Threads . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
Chapter 7: Deploying and Updating Smart Client Applications . . . . . . . . . . . . . . . . . 16
Chapter 8: Smart Client Application Performance . . . . . . . . . . . . . . . . . . . . . . . . . . 16
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
More Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
Chapter 2
Handling Data 17
Types of Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
Read-Only Reference Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
Transient Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Caching Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
The Caching Application Block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Data Concurrency . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
iv Smart Client Architecture and Design Guide
Using ADO.NET DataSets to Manage Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
Merging Data with Datasets. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
Increasing the Performance of Datasets. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
Windows Forms Data Binding. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Windows Forms Data Binding Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
Binding Data to Windows Forms Controls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
Chapter 3
Getting Connected 39
Loosely Coupled and Tightly Coupled Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
Communication Options. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
.NET Enterprise Services. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
.NET Remoting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
Message Queuing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
Web Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
Choosing a Communication Option. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
Designing Connected Smart Client Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
Use Coarse-Grained, Encapsulated Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
Avoid Distributed ACID Transactions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
Avoid Sending Datasets Across the Network. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
Break Up Large Datasets. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
Version Your Web Services and Assemblies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
Chapter 4
Occasionally Connected Smart Clients 51
Common Occasionally Connected Scenarios. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
Occasionally Connected Design Strategies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
The Data-Centric Approach. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
The Service-Oriented Approach . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
Designing Occasionally Connected Smart Client Applications
Using a Service-Oriented Approach. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
Favoring Asynchronous Communication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
Minimizing Complex Network Interactions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
Adding Data Caching Capabilities. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
Managing Connections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
Designing Store-and-Forward Mechanisms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
Managing Data and Business Rule Conflicts. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
Interacting with CRUD-Like Web Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
Using a Task-Based Approach . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
Handling Dependencies. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
Contents v
Chapter 5
Security Considerations 79
Authentication. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
Smart Client Authentication Scenarios . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
Choosing the Right Authentication Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
Network Access Authentication Types. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
Gathering and Validating User Credentials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
Authentication Guidelines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
Authorization. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
Types of Authorization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
Adding Authorization Capabilities to Your Application. . . . . . . . . . . . . . . . . . . . . . . . 94
Authorization Guidelines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
Authorizing Functionality When the Client Is Offline . . . . . . . . . . . . . . . . . . . . . . . . . 96
The Authorization and Profile Application Block. . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
Input Validation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
Handling Sensitive Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
Determining Which Data to Store on the Client . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
Techniques for Protecting Sensitive Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
Code Access Security . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
Code Access Security Permission Resolution . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
Designing for Code Access Security . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
Chapter 6
Using Multiple Threads 113
Multithreading in the .NET Framework . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
Choosing Between Synchronous and Asynchronous Calls . . . . . . . . . . . . . . . . . . . 114
Choosing Between Foreground and Background Threads . . . . . . . . . . . . . . . . . . . . 114
Handling Locking and Synchronization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
Using Timers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
When to Use Multiple Threads . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
Communicating Over a Network . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118
Performing Local Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118
Distinguishing Tasks of Varying Priority. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
Application Startup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
Creating and Using Threads. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
Using the ThreadPool Class. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
Using the Thread Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
Using Delegates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122
Calling Web Services Asynchronously. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
Using Tasks to Handle Interaction Between the UI Thread and Other Threads. . . . . . . 126
Defining a Task Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129
Using the Task Class. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136
vi Smart Client Architecture and Design Guide
Chapter 7
Deploying and Updating Smart Client Applications 137
Deploying the .NET Framework . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138
Preinstalling the .NET Framework . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
Installing the .NET Framework with an Application . . . . . . . . . . . . . . . . . . . . . . . . . 139
Deploying Smart Client Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140
No-Touch Deployment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141
No-Touch Deployment with an Application Update Stub . . . . . . . . . . . . . . . . . . . . . 144
Running Code from a File Share. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146
Xcopy Deployment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
Windows Installer Packages. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
Choosing the Right Deployment Approach. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
Deploying Smart Client Updates. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
No-Touch Deployment Updates. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152
Automatic Updates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152
Updates from a File Share . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153
Xcopy Updates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153
Windows Installer Updates. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154
Choosing the Right Update Approach . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156
Chapter 8
Smart Client Application Performance 157
Designing for Performance. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158
Data Caching Guidelines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160
Network Communications Guidelines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161
Threading Guidelines. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161
Transaction Guidelines. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163
Optimizing Application Startup Time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164
Managing Available Resources. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165
Optimizing Windows Forms Performance. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169
Performance Tuning and Diagnosis. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175
Setting Performance Goals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175
Performance Tuning Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177
Performance Tools. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183
References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183 ...展开收缩
(系统自动生成,下载前可以参看下载内容)

下载文件列表

相关说明

  • 本站资源为会员上传分享交流与学习,如有侵犯您的权益,请联系我们删除.
  • 本站是交换下载平台,提供交流渠道,下载内容来自于网络,除下载问题外,其它问题请自行百度
  • 本站已设置防盗链,请勿用迅雷、QQ旋风等多线程下载软件下载资源,下载后用WinRAR最新版进行解压.
  • 如果您发现内容无法下载,请稍后再次尝试;或者到消费记录里找到下载记录反馈给我们.
  • 下载后发现下载的内容跟说明不相乎,请到消费记录里找到下载记录反馈给我们,经确认后退回积分.
  • 如下载前有疑问,可以通过点击"提供者"的名字,查看对方的联系方式,联系对方咨询.
 相关搜索: " /> name=
 输入关键字,在本站1000多万海量源码库中尽情搜索: