求翻译,介绍asp的
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了求翻译,介绍asp的相关的知识,希望对你有一定的参考价值。
In the last few years we are observing increased use of web applications. This is a consequence of many factors: zero-client installation, server-only deployment, powerful development tools, growing user base etc. Furthermore, competition and the quickly changing and growing user requirements create a demand for rapid development of web applications. Microsoft Visual Studio (MVS) is the dominant web applications development environment of today. MVS provides numerous mechanisms to support rapid development of ASP.NET applications. Most developers tend to use the default ASP.NET mechanisms: page caching; introduction of state in HTTP (session, cookies, hidden HTML controls etc.), data management, and the ASP.NET server controls which are arguably the most significant enabler of the rapid development. Though these mechanisms and ASP.NET server controls can significantly decrease the application’s “time to market”, at the same time they can reduce performance and scalability of the web application. Analysis of factors which influence the response time of web applications is an active area of research. In this paper, we demonstrate the importance of adding custom program logics to ASP.NET server controls in order to improve performance and scalability of web applications. Here we put emphasis on the data binding mechanism, that is, the mechanisms used to maintain and display data. The other mechanism, such as data updating, page caching, data caching, state management etc. are left for future work.
Here we address the following research questions:
What is the impact of the paging mechanism on the response time?
What is the impact of indices on response time when sorting and paging the results?
What is the dependence of the response time on the number of database records?
What are the scenarios when it is better to use ASP.NET server controls? When is it better to use custom stored procedures for fetching, sorting and paging the results?
The outline of our paper is as follows. In Section 2 we are explaining the basics of data binding in ASP.NET applications, how paging is used to cut the expenses for fetching and displaying data, and sorting the data by some field. In Section 3 we are explaining our test environment and the testing approach. Test environment is sued to measure the response time of various ASP.NET pages which implement various methods for data
fetching and display. In Section 4 we explain the results from the tests. The Section 5 concludes the paper and outlines further research.
When using ASP.NET data-bound control like GridView to display the data from a database, the fastest way is to bind the data-bound control with a data-source control, which connects to the database and executes the queries. When using this scenario, the data-source control automatically gets data from the database server and displays it in the data-bound control. Data-source control gets the data from the database server after the Page.PreRender event in the page life cycle.
Another approach to display the data in a data-bound control is to get the data in the Page Load event, store it in a dataset object, and then bind the data-bound control to the dataset. We do not expect significant differences in execution time between the two scenarios, since the reasons for the slow response times (significant amounts of transmitted data, no use of database indices etc.) exist in both scenarios.
问题补充:
当使用asp.net像Grid View数据绑定控件显示数据库中的数据,最快的方式是绑定数据绑定控件与数据源的控制,连接到数据库,执行查询。当使用这种情况下,数据源控件自动获得的数据从数据库服务器并显示在数据绑定控件。数据源控件的数据从数据库服务器后,page.prerender页生命周期事件。另一种办法来显示数据的数据绑定控件是让数据在页面加载事件,它存储在一个数据对象,然后绑定的数据绑定控件的数据。我们不期望显着差异的执行时间的情况下,由于的原因是缓慢的反应时间(大量的数据传输,没有使用数据库指数等)都存在的情况。 参考技术A 当使用asp.net像Grid View数据绑定控件显示数据库中的数据,最快的方式是绑定数据绑定控件与数据源的控制,连接到数据库,执行查询。当使用这种情况下,数据源控件自动获得的数据从数据库服务器并显示在数据绑定控件。数据源控件的数据从数据库服务器后,page.prerender页生命周期事件。另一种办法来显示数据的数据绑定控件是让数据在页面加载事件,它存储在一个数据对象,然后绑定的数据绑定控件的数据。我们不期望显着差异的执行时间的情况下,由于的原因是缓慢的反应时间(大量的数据传输,没有使用数据库指数等)都存在的情况。
ABP官方文档翻译 5.1 Web API控制器
ASP.NET Web API控制器
ABP通过Abp.Web.Api nuget包集成到ASP.NET Web API控制器。你可以按照往常一样创建ASP.NET Web API控制器。依赖注入系统可以用于一般的ApiControllers。但是,建议继承AbpApiController,它提供了许多好处并且能够更好的与ABP集成。
这有一个简单的继承自AbpApiController的api控制器:
public class UsersController : AbpApiController { }
AbpApiController定义了L方法,它使本地化更加简单。示例:
public class UsersController : AbpApiController { public UsersController() { LocalizationSourceName = "MySourceName"; } public UserDto Get(long id) { var helloWorldText = L("HelloWorld"); //... } }
需要设置LocalizationSourceName才能使L方法正常使用。可以在基类api控制器里设置,这样就不用在每个api控制器里重复设置了。
你也可以使用预注入的AbpSession,EventBus,PermissionManager,PermissionChecker,
SettingManager,FeatureChecker,LocalizationManager,Logger,CurrentUnitOfWork基础属性等。
ABP为AspNet Web API定义了一些预生成的过滤器。他们默认添加到所有控制器的所有动作上。
AbpApiAuditFilter用来集成审计日志系统。它默认记录所有动作的请求(如果审计没有被禁用)。你可以使用Audited和DisableAuditing特性来控制动作和控制器。
你可以给控制器或动作使用AbpApiAuthorize特性来禁止未授权的用户使用你的控制器和动作。示例:
public class UsersController : AbpApiController { [AbpApiAuthorize("MyPermissionName")] public UserDto Get(long id) { //... } }
你可以为动作或控制器定义AllowAnoymous特性来禁用认证或授权。AbpApiController也定义了IsGranted方法作为在代码中检查权限的捷径。
参见授权文档了解更多。
AbpAntiForgeryApiFilter用来自动保护ASP.NET Web API 的POST、PUT和DELETE请求动作免受CSRF/XSRF的攻击。参见CSRF文档了解更多。
AbpApiUowFilter用来集成工作单元系统。它在动作执行之前自动开始一个新的工作单元,并在动作执行结束之后完成工作单元(如果没有异常抛出)。
你可以使用UnitOfWork特性来控制动作UOW的行为。你也可以使用启动配置来为所有的动改变默认的工作单元特性。
如果动作成功完成,ASP.NET Boilerplate默认不包装Web API动作。但是它处理和包装异常。如果需要,你可以给动作或控制器添加WrapResult/DontWrapResult特性。你可以在启动配置里(使用Configuration.Modules.AbpWebApi()...)改变默认的行为。参见AJAX文档了解更多关于结果包装的信息。
ABP为WebAPI请求的响应添加缓存控制header(no-cache,no-store)。因此,它阻止浏览器缓存相应,甚至GET请求也会被阻止缓存。可以在配置里禁用此功能。
AbpApiValidationFilter自动检查ModelState.IsValid,如果校验失败则阻止动作的执行。还实现了输入DTO的校验,如在校验文档中所描述。
AbpApiDateTimeBinder用来标准化DateTime(还有Nullable<DateTIme>)输入,使用Clock.Normalize方法。
以上是关于求翻译,介绍asp的的主要内容,如果未能解决你的问题,请参考以下文章