自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

Just Do IT

爱上晨搂

  • 博客(3)
  • 资源 (4)
  • 收藏
  • 关注

原创 delete ,truncate, drop 的不同处

不同点: 1. truncate和 delete只删除数据不删除表的结构(定义) drop语句将删除表的结构被依赖的约束(constrain),触发器(trigger),索引(index); 依赖于该表的存储过程/函数将保留,但是变为invalid状态. 2.delete语句是dml,这个操作会放到rollback segement中,事务提交之后才生效;如果有相应的trigger,执行的时候将被

2005-12-19 10:50:00 804

原创 Java学习从入门到精通 --

一、 JDK (Java Development Kit) JDK 是整个Java的核心,包括了Java运行环境(Java Runtime Envirnment),一堆Java工具和Java基础的类库(rt.jar)。不论什么Java应用服务器实质都是内置了某个版本的JDK。因此掌握 JDK是学好Java的第一步。最主流的JDK是Sun公司发布的JDK,除了Sun之外,还有很多公司和组织都开发了自

2005-06-21 17:22:00 858

原创 成长中必须知道的20个故事

1、断箭    不相信自己的意志,永远也做不成将军。    春秋战国时代,一位父亲和他的儿子出征打战。父亲已做了将军,儿子还只是马前卒。又一阵号角吹响,战鼓雷鸣了,父亲庄严地托起一个箭囊,其中插着一只箭。父亲郑重对儿子说:“这是家袭宝箭,配带身边,力量无穷,但千万不可抽出来。”    那是一个极其精美的箭囊,厚牛皮打制,镶着幽幽泛光的铜边儿,再看露出的箭尾。一眼便能认定用上等的孔雀羽毛制作。儿子喜

2005-06-15 17:04:00 859

Smart Client Architecture

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

2008-05-26

.NET Framework Essentials

.NET Framework Essentials is a concise and technical overview of the new Microsoft .NET Framework.<br>Covered here are all of the most important topics—from the underlying Common Language Runtime<br>(CLR) to its speci alized packages for ASP.NET, Web Forms, Windows Forms, XML and data access<br>(ADO.NET). The authors survey each of the major .NET languages, including VB.NET, C# and<br>Managed C++.

2008-05-26

Programming WCF Services

Programming WCF Services--O'Reilly

2008-05-26

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除