net概述和改进_第1页
net概述和改进_第2页
net概述和改进_第3页
net概述和改进_第4页
net概述和改进_第5页
已阅读5页,还剩7页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、ASP.NET 概述和改进ADONET性能ASP.NET是一个统一的web 开发模型,它包括您使用尽可能少的代码生成企业级Web 应用程序所必需的各种服务。ASP.NET 作为NET Framework 的一部分提供。当您编写ASP.NET 应用程序的代码时,可以访问NET Framework 中的类。您可以使用与公共语言运行库(CLR )兼容的任何语言来编写应用程序的代码,这些语言包括Microsoft visual Basic 、C#、JavaScript . NET 和J。使用这些语言,可以开发利用公共语言运行库、类型安全、继承等方面的优点的ASP . NFT应用程序。ASP.NET包括

2、:l 页和控件枢架l ASP.NET 编译器l 安全基础结构l 状态管理功能l 应用程序配置l 运行状况监视和性能功能l 调试支持l XML Web services 框架l 可扩展的宿主环境和应用程序生命周期管理l 可扩展的设计器环境ASP.NET 页和控件枢架是一种编程框架,它在Web 服务器上运行,可以动态地生成和呈现ASP.NET 网页。可以从任何浏览器或客户端设备请求ASP.NET网页,ASP.NET 会向请求浏览器呈现标记(例如HTML )。通常,您可以对多个浏览器使用相同的页,因为ASP.NET会为发出请求的浏览器呈现适当的标记。但是,您可以针对诸如Microsoft Inter

3、net Explorer 6 的特定浏览器设计ASP.NET 网页,并利用该浏览器的功能。ASP.NET 支持基于Web 的设备(如移动电话、手持型计算机和个人数字助理(PDA) )的移动控件。ASP.NET 网页是完全面对对象的。在ASP.NET 网页中,可以使用属性、方法和事件来处理HTML 元素ASP.NET 页框架为响应在服务器上运行的代码中的客户端事件提供统一的模型,从而使您不必考虑基于Web 的应用程序中固有的客户端和服务器隔离的实现细节。该框架还会在页处理生命周期中自动维护页及该页上控件的状态。 使用ASP.NET 页和控件框架还可以将常用的UI 功能封装成易于使用且可重用的控件

4、。控件只需编写一次,即可用于许多页并集成到ASP.NET 网页中。这些控件在呈现期间放入ASP.NET 网页中。 ASP.NET 页和控件框架还提供各种功能,以便可以通过主题和外观来控制网站的整体外观和感觉。可以先定义主题和外观,然后在页面级或控件级应用这些主题和外观。 除了主题外,还可以定义母版页,以使应用程序中的页具有一致的布局。一个母版页可以定义您希望应用程序中的所有页(或一组页)所具有的布局和标准行为。然后可以创建包含要显示的页特定内容的各个内容页。当用户请求内容页时,这些内容页与母版页合并,产生将母版页的布局与内容页中的内容组合在一起的输出 所有ASP.KET 代码都经过了编译,可提

5、供强类型、性能优化和早期绑定以及其他优点。代码一经编译,公共语言运行库会进一步将ASP.NET 编译为本机代码,从而提供增强的性能。 ASP.NET 包括一个编译器,该编译器将包括页和控件在内的所有应用程序组件编译成一个程序集,之后ASP.NET 宿主环境可以使用该程序集来处理用户请求。 除了. NET 的安全功能外,ASP.NET 还提供了高级的安全基础结构,以便对用户进行身份验证和授权,并执行其他与安全相关的功能。您可以使用由IIS 提供的Windows 身份验证对用户进行身份验证,也可以通过您白己的用户数据使用ASP.NET Forms身份验证和ASP.NET成员资格来管理身份验证。此外

6、,可以使用Windows 组或您自己的自定义角色数据库(使用ASPNET 角色)来管理Web 应用程序的功能和信息方面的授权。您可以根据应用程序的需要方便地移除、添加或并换这些方案。 ASP.NET 始终使用特定的Windows 标识运行,因此您可以通过使用w indows 功能(例如NTFS 访问控制列表(ACL )、数据库权限等等)来保护应川、用程序的安全。 ASP. NET 提供了内部状态管理功能,它使您能够存储页请求期间的信息,例如客户信息或购物车的内容。您可以保存和管理应用程序特定、会话特定、页特定、用户特定和开发人员定义的信息。此信息可以独立于页上的任何控件。ASP.NET 提供了

7、分布式状态功能,使您能够管理一台计算机或数台计算机上同一应用程序的多个实例的状态信息。 通过ASP.NET 应用程序使用的配置系统,可以定义Web 服务器、网站或单个应用程序的配置设置。您可以在部署ASP.NET 应用程序时定义配置设置,并且可以随时添加或修订配置设置,且对运行的Web 应用程序和服务器具有最小的影响。ASP.NET 配置设置存储在基于XML 的文件中。由于这些XML 文件是ASCII 文本文件,因此对Web 应用程序进行配置更改比较简单。您可以扩展配置方案,使其符合自己的要求。 ASP.NET 包括可监视ASP.NET 应用程序的运行状况和性能的功能。使用ASP . NFT

8、运行状况监视可以报告关键事件,这些关键事件提供有关应用程序的运行状况和错误情况的信息。这些事件显示诊断和监视特征的组合,并在记录哪些事件以及如何记录事件等方面提供了高度的灵活性。ASP.NET 支持两组可供应用程序访问的性能计数器: ASP.NET 系统性能计数器组 ASP.NET 应程序性能计数器组ASP.NET 利用运行库调试基础结构来提供跨语言和跨计算机调试支持。可以调试托管和非托管对象,以及公共语言运行库和脚本语言支持的所有语言。这章提供证明策略帮助你设计并且发展可调节的数据存取解决办法。本文包括不同的技术来通过数据遍布应用层,管理数据库连接工具,优化储存的过程调用,降低数据集的大量销

9、费,通过大量结果数据集标识的技术,管理传送,操作BLOBS 等。目标优化数据存取设计在Data Sets 和Data Readers 之间做出选择运行有效的数据库命令有效地在层之间流通数据进行有效的交易优化连接管理评估记录标识费用评估分析数据存取性能标准BLOB 操作方案的执行性能概述精心设计的数据访问代码和数据处理命令是应用性能和可伸缩性的根本要素。通常,数据库是一个由大量应用请求需要来自数据库的数据导致的应用负载的焦点。这章为设计和实施数据访问代码的性能及可伸缩性提供证明策略。如何使用使用这章可以改进数据访问代码性能及伸缩性的实施为了最有效地使用这章,考虑如下内容: · 只读标题

10、或者从开始读到结束。这章主要标题帮助你迅速鉴定然后找到使你感兴趣的题目。或者,你可以从头到尾地读获得完整的影响ADO. NET 性能问题那一章。 · 使用检查表。使用“检查表:ADO.NET 性能”迅速在”检查表”部分看到和评估人在这儿章内提出的那些指南。 · 使用这章的“结构”部分理解ADO.NET 怎样工作。通过理解结构,你能更好地设计和实施选择。理解ADO.NET核心组成部分,例如数据支持对象和数据集对象。 · 使用“设计方案”来理解那些将影响ADONET代码选择的实施的高级决定 · 度量应用性能。了解你所能使用度量应用性能的关键计量学。你必须度量

11、应用性能,以便你能鉴定并且解决执行问题。 · 测试你的应用性能。“测试.NET 应用性能”获悉怎样把性能试验应用于你的应用程序。你必须使用一个前后一致的测试过程并且分析结果。 · 调试应用性能。通过“协调NET 应用性能”来了解怎样通过使用协调计量学鉴定解决性能问题。 · 调试SQLServer 。读第14 章“提高SQL 性能”,确保你的Mi crosoft®SQL Server 数据库格式正确。结构性 ADO . NET 依赖数据支持提供进入基础数据源的途径。每个数据支持显示你所使用的管理连接,恢复数据,更新数据。核心对象是如下内容:· 连

12、接· 命令· 数据读取器· 数据适配器 另外,ADO . NET 提供DataSet 对象,来提供分离的高速数据缓存。DataSet 对象不需要一种数据源的具体的类型并且不被所获得的基础数据源数据所束缚。基本的ADO . NET 结构如图12 . 1 所示。 图12.1 ADO.NET 结构图 下列目录略述每个主要ADO.NET 物体的对象:· 连接。这个对象描述对数据库的一个连接· 命令。这个对象代表当连接一个数据源时被运行的一个SQL 语句。这个对象可能是一个储存的程序或者一个直接的SQL 语句。· 数据读取器。这个对象用来恢复一

13、条来自数据库的数据的只读数据流。与以功能性作为代价将数据读进一个DataSet对象相比较,DataReader 对象是为连接脚本设计的并且能提供更好的性能。· 数据适配器。来自一个Data Set 对象和基础的数据源的对象信道数据。数据适配器对象也提供以前与Record set 对象相关的改进的批处理特征。· 数据集。数据集对象描述一个分离的,隐藏的数据集。数据集不依赖提供者并不被可能依附于它的基础的数据源所束缚。数据集能容易地从部件到部件通过各种各样层来应用,并且它可以被作为XML 连载。 你应该了解数据集内部建造的方式,因为数据集包含一个潜在的大量的内部对象。这表明许多

14、存储分配程序被要求建造典型的数据集。 数据集由一个或更多数据表对象以及数据关剔象组成。每个数据表包含数据行w 对象和数据列对象。限制对象用来代表可以被在一个或更多数据列对象上实施的限制条件。注意 你也能使用从基本数据集派生来的典型数据集。典型数据集优越性在于构造时间和运行时间。· 数据视图。数据视图对象虽然不在12.1 图显示,但是你能使用一个数据视图使数据在数据表内存储和分类。这种性能经常用于具有约束力的数据。ASP.NET Overview and Improving ADO . NET PerformanceASP.NET is a unified Web developmen

15、t model that includes the services necessary for you to build enterprise-class Web applications with a minimum of coding . ASP.NET is part of the . NET Framework , and when coding ASP.NET applications you have access to classes in the . NET Framework . You can code your applications in any Language

16、compatible with the common language runtime ( CLR ) , including Microsoft Visual Basic , C # , . NET , and J # . These languages enable you to develop ASP. NET applications that benefit from the common language runtime , type safely , inheritance , and so on . ASP.NET Includes :l A page and controls

17、 framework l The ASP.NET compiler l Security infrastructure l State-management facilities l Application configuration l Health monitoring and performance features l Debugging support l An XML Web services framework l Extensible hosting environment and application life cycle management l An extensibl

18、e designer environment The ASP.NET page and controls framework is a Programming framework that runs on a Web server to dynamically produce and render , ASP.NET Web pages . ASP.NET Web pages can be requested form any browser or client device , and ASP.NET renders markup ( such as HTML ) to the reques

19、ting browser , As a rule , you can use the same page for multiple browsers , because ASP.NET renders the appropriate markup for the browser making the request . However , you can design your ASP.NET Web page to target a specific browser , such as Microsoft Internet Explorer 6 , and take advantage of

20、 the features of that browser . ASP.NET supports mobile controls for Web-enabled devices such as phones , handheld computers , and personal digital assistants ( PDAS ) . ASP.NET Web pages are completely object-oriented . Within ASP.NET Web pages you can work with HTML elements using properties , met

21、hods , and events . The ASP.NET page framework removes the implementation details of the separation of client and server inherent in Web -based applications by presenting a unified model for responding to client events in code that runs at the server . The framework also。automatically maintains the

22、state of apage and the controls on that Page during the page processing life cycle . The ASP.NET page and controls framework also enables you to encapsulate common UI functionality in easy-to-use , reusable controls . Controls are written once , can be used in many pages , and are integrated into th

23、e ASP.NET Web page that they are placed in during rendering . The ASP.NET page and controls framework also provides features to control the overall look and feel of your Web site via themes and skins . You can define themes and skins and then apply them at a page level or at a control level . In add

24、ition to themes , you can define master pages that you use to create a consistent layout for the pages in your application . A single master page defines the layout and standard behavior that you want for all the pages ( or a group of pages ) in your application . You can then create individual cont

25、ent pages that contain the page-specific content you want to display . When users request the content pages . they merge with the master page to Produce output that combines the layout of the master page with the content from the content page . All ASP.NET code is compile , which enables strong typi

26、ng , performance optimizations , and early binding . among other benefits . once the code has been compiled , the common language runtime further compiles ASP.NET code to native code , Providing improved performance . ASP.NET includes a compiler that will compile all your application components incl

27、uding pages and controls into an assembly that the ASP.NET hosting environment can then use to service user requests , In addition to the security features of . NET , ASP.NET provides an advanced security infrastructure for authenticating and authorizing user access as well as performing other secur

28、ity-related tasks .You can authenticate users using Windows authentication supplied by IIS . or you can manage authentication using your own user database using ASP.NET forms authentication and ASP.NET membership . Additionally , you can manage the authorization to the capabilities and information o

29、f your Web application using Windows groups or your own custom role database using ASP.NET roles . You can easily remove . add to , or replace these schemes depending upon the needs of your application . ASP.NET always runs with a particular Windows identity so you can secure your application using

30、Windows capabilities such as NTFS Access Control Lists ( ACLS ) , database permissions , and so on , For more information on the identity of ASP.NET , ASP.NET provides intrinsic state management , functionality that enables you to store information between page requests , such as customer informatio

31、n or the contents of a shopping cart . You can save and manage application-specific , session-specific , page-specific , user-specific , and developer-defined information . This information can be independent of any controls on the page . ASP.NET offers distributed state facilities ,which enable you

32、 to manage state information across multiple instances of the same application on one computer or on several computers . ASP.NET applications use a configuration system that enables you to define configuration settings for your Web server , for a Web site , or for individual applications . You can m

33、ake configuration settings at the time your ASP.NET applications are deployed and can add or revise configuration settings al any time with minimal impact on operational Web applications and servers . ASP.NET configuration settings are stored in XML-based fies . Because these XML files are ASCII tex

34、t files , it is simple to make configuration changes to your Web applications . You can extend the configuration scheme to suit your requirements . ASP.NET includes features that enable you to monitor health and performance of your ASP.NET application . ASP.NET health monitoring enables reporting of

35、 key events that provide information about the health of an application and about error conditions , These events show a combination of diagnostics and monitoring characteristics and offer a high degree of flexibility in terms of what is logged and how it is logged . ASP.NET supports two groups of p

36、erformance counters accessible to your applications : The ASP.NET system performance counter group The ASP.NET application performance counter group ASP.NET takes advantage of the run-time debugging infrastructure to provide cross-language and cross-computer debugging support . You can debug both ma

37、naged and unmanaged objects , as well as all languages supported by the common language runtime and script languages .This chapter provides proven strategies to help you design and develop scalable data access solutions . Topics covered include different techniques to pass data across application la

38、yers , managing the database connection pool, optimizing stored procedure calls , reducing dataset serialization cost , techniques for paging through large result sets , managing transactions , handling BLOBS , and much more .ObjectivesOptimize your data access design . Choose between Datasets and D

39、ata Readers . Run efficient database commands . Pass data between layers efficiently Perform efficient transactions . Optimize connection management . Evaluate the cost of paging through records . Evaluate criterion for analyzing data access performance . Apply Performance considerations to binary l

40、arge object ( BLOB ) . Overview Well-designed data access code and data processing commands are essential elements for application performance and scalability,Typically the database is a focal point for application load because the majority of application requests require data that comes from a data

41、base. This chapter provides proven strategies for designing and implementing data access code for performance and scalability How to Use This Chapter Use this chapter to improve the implementation of your data access code for performance and scalability. To get the most out of this chapter , conside

42、r the following : Jump to topics or read beginning to end . The main headings in this chapter help you to quickly identify and then locate the topic that interests you . Alternatively , you can read the chapter beginning to end to gain a thorough appreciation of the issues that affect ADO.NET perfor

43、mance . Use te checklist . Use " Checklist : ADO.NET Performance " in the " Checklist " section of this guide to quickly view and evaluate the guideline presented in this chapter. Use the " Architecture" section of this chapter to understand how ADO.NET worksBy understa

44、nding the architecture , you can make better design and implementation choices . Understand core ADO.NET components,such as data provider objects and the Dataset object . Use the " Design Considerations" section of this chapter to understand the high-level decisions that will affect implem

45、entation choices for ADO. NET Code. Measure your application performance . learn about the key metrics that you can use to measure application performance You have to measure application performance so that you can identify and resolve performance issues . Test your application performance .Testing

46、.NET Application Performanceto learn how to apply performance testing to your application . You have to apply a coherent testing process and analyze the results .Tune your application Performance. Tuning .NET Application Performanceto learn how to resolve performance issues that you identify through

47、 the use of tuning metrics . Tune SQL Server.Reed Chapter 14 , " improving SQL Server Performance to ensure that your Microsoft® SQL server database is appropriately configured.ArchitectureADO.NET relies on data providers to provide access to the underlying data source . Each data provider

48、 exposes a set of objects that you use to manage connections , retrieve data , and update data.The core objects are the following : Connection Command Data Reader Data Adapter In addition , ADO.NET provides the Dataset object , which provides a disconnected cache of data .the Dataset object does not

49、 require a specific type of data source and is not tied to the underlying data source that the data was obtained from. The basic AD0.NET architecture is shown in Figure l2.l.Figure 12.1:ADO.NET architectureThe following list outlines the purpose of each of the main AD0. NET objects: Connection . This object represents a connection to a database . Command . This object represents an SQL statement that is run while connected to a data source . This object can be a stored procedure or a direct SQL statement Data Reader. This object retrieves a read-only , forward-only stream of data from

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论