DotNetNuke Skinning Whitepaper 翻译记录(技术部分)

翻译: 

技术

有很多种方法可以从页面上提取用户界面元素,每种方法都包含不同程度的分解元素,需要将表现层与业务层融合在一起。因此,定义何处,何时,以及这些分解元素如何产生成为整个解决方案的重点。

在很多脚本语言中很流行的一种技术是用在用户界面文件中使用标记或标识符描述动态函数,当页面被载入时,这些标识符将被对应的应用逻辑取代。不管采用什么方法(智能分解,字符串函数,正则表达式等等)来完成这个替换工作,关键在于web应用程序的界面是当页面被处理的时候产生的,如果在每个请求之后都进行一次替换工作,那么性能将无可避免的受到影响。为了减轻这种影响,最佳的解决方案需要利用预处理或者汇编技术。

ASP.NET 提供了强大的抽象web页面成为一个组件的特性。用户控件类似于传统的ASP中的 #include标志除了???。原文: User Controls are similar to classic ASP #include directives… except on steroids.,后面那个不知道如何翻译,谁知道的指教一下不胜感激.)用户控件使得分离用户界面和在不同页面重用成为可能。用户控件和一个aspx页面只有两个差别:一个是后缀,用户控件的后缀为ascx,另一个就是他可以不包含<HTML>, <Body>, 或者 <Form>标签,其他几乎没有区别。用户控件可以插入大量的文件中,将表现层从应用程序或者后台代码中分离出来。这个特性允许创建大量的引用同一后台代码的表现层文件 ,另外由于ASP.NET是一种编译过的语言,页面由大量的编译过的用户控件组成,这使得传送的效率相当高,比那些解释型的语言来得快得多。

原文  :

Technology

The abstraction of user interface elements from a page can be accomplished using many different strategies. Each strategy invariably includes some degree of parsing to merge the presentation with the business logic. Therefore, defining where, when, and how this parsing will take place becomes critical to the entire solution.

A popular technique employed in many script languages is to use tokens or identifiers in the user interface files to represent dynamic functionality. When the page is processed, the identifiers are replaced with the appropriate application logic. Regardless of the method chosen to perform the replacement ( ie. intelligent parsing, string functions, regular expressions, etc… ), the key point to emphasize in web application skinning is the phrase “when the page is processed”. If the replacement is being done on each page request, the performance of the application is going to be affected. To mitigate this performance impact, the optimal solution needs to take advantage of pre-processing or compilation technologies.

ASP.NET provides a very powerful feature for abstracting web pages into individual components. User Controls are similar to classic ASP #include directives… except on steroids. User controls allow you to isolate user interface functions and reuse them in other ASP.NET pages. A user control is almost identical to a normal .aspx page, with two differences: the user control has the .ascx extension rather than .aspx, and it may not have <HTML>, <Body>, or <Form> tags. User controls can be broken into multiple files, separating the presentation from the application logic or “code-behind” file. This feature allows multiple presentation files to be created which can all reference the same “code-behind” file. And due to the fact that ASP.NET is a compiled language, pages comprised of multiple user controls are assembled and rendered very efficiently – certainly faster than non-compiled or interpreted code.

DotNetNuke Skinning Whitepaper 翻译记录:
DotNetNuke Skinning Whitepaper 翻译记录(简介部分)
DotNetNuke Skinning Whitepaper 翻译记录(术语与win客户端程序部分)
DotNetNuke Skinning Whitepaper 翻译记录(技术部分)
DotNetNuke Skinning Whitepaper 翻译记录(定义部分)
DotNetNuke Skinning Whitepaper 翻译记录(DotNetNuke部分)

posted @ 2004-11-23 22:00  SHoTDoG  阅读(1678)  评论(3编辑  收藏  举报