ImageVerifierCode 换一换
格式:DOCX , 页数:9 ,大小:123.53KB ,
资源ID:17507902      下载积分:3 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bdocx.com/down/17507902.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(计算机 外文翻译 外文文献 英文文献及译文一种新的网络应用程序开发框架MVCWord格式文档下载.docx)为本站会员(b****5)主动上传,冰豆网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰豆网(发送邮件至service@bdocx.com或直接QQ联系客服),我们立即给予删除!

计算机 外文翻译 外文文献 英文文献及译文一种新的网络应用程序开发框架MVCWord格式文档下载.docx

1、本文中,基于MVC1的网络应用程序的设计模式是为解决这两类因素扩展性和可维护性这些不易处理的问题。把MVC设计模式引入网络应用程序开发,执行逻辑可以独立于系统的表现形式。 MVC由三种对象组成。1)模型:是应用对象,2)视图:是它的屏幕的显示,3)控制器:定义用户界面并对输入的信息做出响应。在出现MVC之前,用户界面的设计倾向于把这些东西做在一起。然而,MVC独立了它们,增加系统的灵活性和可重用性。MVC把视图和模型独立开来,在它们之间建立了“subscribe/notify”协议。一个视图必须确保其正确反映模型的状态。每当模型的数据发生改变,视图会得到相应的通知。作为回应,每个视图都会有更新

2、自身的机会。这个方法可以让你附上一个模型的多个视图以便提供不同的报告。你也可以不改变原模型同时创建新的视图。2.背景和存在的问题 虽然MVC的设计模式已经在smalltalk-80中提出了,并广泛应用于软件设计,介绍它到网页应用程序开发却仍很困难的。主要由于以下两个因素:1)首先,很难独立 来自HTML的编程语言。早期的CGI程序使用字符串输出创造了HTML内容。默认的,将HTML文本分成几份,然后把他们嵌入到CGI程序中。脚本语言出现后,变成了脚本语言编写的程序嵌入到HTML文本中。然而,这两种方法有一个共同的不足,使他们不能完全独立于HTML文本。因此,这两种方法使采用MVC分离三层模式十

3、分难以实现。2)第二,脚本语言的功能太弱。他们缺乏一些必要的技术支持来采用MVC的设计模式,如消息机制和事件回应机制。直到JSP Model2版,这种情况并没有受到任何改善。依靠强大的Java语言功能,JSP Model24某种程度上实行MVC设计理念。图 1显示了MVC的机制:模型(数据层):它是封装到企业JavaBean。视图(表示层):JSP负责的网页方式,如报告的格式,分页等。控制器(控制层):Servlet受到网页上的用户的输入并执行有关的操作(呼叫相应的EJB组件),给出了相关视图,所以JSP会呈现这些结果。 JSP Model2机制主要满足了开发商对要求Web应用逻辑和用户界面独

4、立的需求。但制仍然存在某些限,例如,尽管JSP Model2已经实施采用MVC设计模式的基本理念,三个层次之间的相互关系(Servlet,Java Bean/ EJB和JSP)仍然封闭。特别是,就Servlet当控制器,不仅控制选择同时响应模型的模块,还负责对处理JSP转移数据提供模块。因为这一过程,Servlet本身已实现非常复杂的执行逻辑,对于体系的发展和维护这是正是一个棘手的问题。因此,在下面的网络应用系统框架,我们会进一步划分出功能的控制器。3.解决方案 图2中显示,这一系统框架包含三个内核控制对象/类(SYSController, Model Center, and LPM(Logi

5、cal Page Module) Center)和它们的核心数据库(system description database, model database, and LPM database)。这三个控制对象/类根据原始的控制器划分。通过这些控制对象/类和数据库,下文将解释部分的设计思想和该系统框架的实现机制。 首先,我们考虑SYSController和系统的描述数据库。他们负责接收用户的要求和根据这些请求搜索有关的执行逻辑。系统描述数据库可以是一个XML2文件或一套XML文件。这个数据库描述了不同的执行逻辑与不同的用户请求。执行逻辑主要包括互动模式、数据来源与异常处理等,这些组织在一个树形结

6、构中。而SYSController可以搜索系统描述数据库。它结合了用户的要求和来自数据的执行逻辑,然后把它们交给传输器来封装。SYSController有两种方法搜索数据库。 其一是使用DOM对象(Document Object Model)3。当应用程序系统开机,这样需要DOM解析器分析整个数据库备案后载入内存。数据库将保留在内存中的DOM树结构。另一种是使用SAX(Simple API for XML)接口。两者有各自的优缺点。使用DOM可以实现结构搜索。它可以在大型数据库上使用,但是会暂用更多的系统资源。而SAX接口以高效率和更少的系统资源占用率著称。唯一的缺点是它获得信息比DOM难。

7、其次,我们考虑模型中心和模型数据库。该层通过调用给定模块完成定义执行逻辑。模型数据库包括大量的对象和模块。这些对象和模块根据特定的执行逻辑封装响应方法。当模式中心接收到的执行消息,它根据封装在信息里的执行逻辑选择合适的对象或模块。然后按照给定的数据格式封装模块,冰传输给LPM中心。此外,每个对象或模块只需要关心如何实现给定的事务的逻辑以及如何获得必要的数据而不提交这些数据。 最后,我们研究一下LPM中心和LPM数据库。LPM是实施描述的某一种数据类型的项目集合,它可以当成是一个或一组磁盘文件。在另一方面,有一个网页可有一个逻辑页或多条逻辑页。一个LPM的功能是很简单的:它只需要在没有被得到执行

8、逻辑和原数据内容的情况下给定数据类型。因此事实上,LPM是作为标签库(JSP)或数据捆绑(.net)而开发的。此外,这种类型的服务器脚本可以很容易由客户开发人员在UI(user interface)设计阶段理解,what-you-see-is-what-you-get(所见即所得)工具也很容易开发。在这部分,LPM中心从模型中心收到数据。它根据给定数据类型和执行逻辑选择适当的逻辑页模块,然后封装逻辑页的输出模块到HTTP响应并将发布到客户端。注意到这3个控制对象,除了SYSController,另外两个不是直接进入自己的核心数据库。例如,模式中心不直接从模型数据库调用对象或模块。它实现了通过M

9、odelFactory的存取。(过程见图2) 通过分析系统框架,可以看出整个系统完全符合MVC设计模式。在在系统的开发时期各部分的开发者三者冰不具有相互的干涉。当系统框架已确定,各部分惊人的发现开发的相似。在过去这对网络应用程序的开发来说是不可能的。因为我们已经把控制器分为3个部分,MVC三层(模型/视图/控制器)的联系变得更加宽松。所以它可以明显提高整个系统的可扩充性。在下一节,我们将向你展示一个简单的例子去解释如何在三层MVC模式的过程通过增加中间执行步骤扩大系统框架。4.相关问题 检查目前的网络应用程序设计模式(如CGI,JSP Model2等等),我们可以获得初步结果:MVC模式是一个

10、优于其他系统逻辑框架的网站应用系统开发模式,它平衡了合作开发、系统的可扩展性和可维护性。这主要由于旧设计模式对系统逻辑框架的独立性的不足之处。例如,在通过CGI开发的网页系统中,CGI程序不仅需要处理执行逻辑,同时也负责系统报告的格式。因此,它要求开发者有很强的编程能力(他们必须非常熟悉执行规划和界面设计)。此外,它甚至会使系统的逻辑层次混乱。最后,混沌编码会带来一系列的问题。使用服务器脚本语言(如ASP,PHP等等)实现的网页应用系统也不符合要求。其原因是,这些脚本语言都有天生的缺陷(例如,他们却没有有好的对象支持和事件响应机制等);他们不能令人满意地缩短网络应用系统的执行逻辑。由此JSP

11、Model2的不足已在上文描述过了,所以没有这个必要在这赘述了。5.结论 从上述对系统框图的分析,我们可以做一个结论。改进后的MVC设计模式框架比传统方法有更清楚的结构,每个模块间的联系甚少。框架解决是一个大问题,曾困惑很多网络开发者。它将执行逻辑从表现模式独立出来,实施并行进行发展。此外,利用模型数据库和LPM数据库,这个更系统的灵活性、可维护性和可扩充性得到了显著提高。本篇讨论的框架已经在UEST网络应用系统上得以实施()。参考文献1 Erich Gamma. Design Patterns. U.S. Addison-Wesley Pub Co.2 Didier Martin. Prof

12、essional XML. U.K. Wrox Press.3 Stephen T. Mohr. Designing Distributed Applications with XML, ASP, IE5,LDAP & MSMQ. U.K. Wrox Press.4 Sun Microsystems Inc. JavaTM Servlet 2.3 and JavaServer PagesTM 1.2 Spec fications.5 Sun Microsystems Inc. JavaServer PagesTM Standard Tag Library Specification原文一:A

13、Novel Web Application FrameDeveloped by MVCLuo GuangChun WangYanhua Lu Xianliang Hanhong*(Information Center of UEST of China, ChengDu, China 610054)AbstractThe MVC (Model/View/Controller) design pattern was developed in Smalltalk-80 and widely used in software design. This paper introduces a novel

14、Web application frame based on MVC. This frame separates the transaction logic from the presentation format. It also improves the system maintainability, scalability and performance by using the module database, template database, messaging object and buffer queue.Key words: MVC, Design Pattern, Web

15、 Application1. Introduction Web application system is a transaction system based on B (rowser)/S(erver) model. It exploits many kinds of dynamic Web developing technologies. At present, Web application developing patterns and tools are one of the topics of the software design. They directly influenc

16、e several key factors such as maintainability, scalability, stability and the security. In this paper, the purpose of MVC1-based Web application design pattern is to resolve the two factors maintainability and scalability, which are the stubborn problems in the Web application development. By introd

17、ucing the MVC design pattern into the Web application development, the implementation of system transaction logic can be separated from the system presentation.MVC consists of three kinds of objects. 1) the Model: is the application object, 2) the View: is its screen presentation, 3) the Controller:

18、 defines the way the user interface reacts to user input. Before MVC, user interface designs tended to lump these objects together. However, MVC decouples them to increase the flexibility and reuse. MVC decouples views and models by establishing a “subscribe/notify” protocol between them. A view mus

19、t ensure that its appearance reflects the state of the model correctly. Whenever the models data changes, the model notifies views that depend on it. In response, each view gets an opportunity to update itself. This approach lets you attach multiple views to a model to provide different presentation

20、s. You can also create new views for a model without rewriting it.2. Background and Problems Even though the MVC design pattern was already put forward in smalltalk-80 and widely used in software design, it is difficult to introduce it into the Web application development. It was mainly due to the f

21、ollowing two factors: 1) First, it was difficult to separate the programming language from HTML. Early CGI programs created the HTML content by using character string output. In nature, it divided the HTML content into several portions, and then inserted them into the CGI programs. After the appeara

22、nce of Script languages, the way changed to insert the programs written by script languages into HTML content. However, these two ways had a common deficiency that they could not separate the programs from the HTML content absolutely. Therefore, it is very difficult to implement the MVC detached thr

23、ee-layer pattern based on these two ways. 2) Second, functions of the script languages are less weak. They lack some necessary technologies to support the MVC design pattern, such as message mechanism and event response mechanism. This situation did not get any improvement until the release of the J

24、SP Model 24. Depending on the powerful functions of Java language, the JSP Model 2 implements the MVC design idea to some extent. Figure 1 shows the mechanism: Model (the data layer): it is encapsulated into the Enterprise JavaBean. View (the presentation layer): JSP is responsible for the presentat

25、ion of pages, such as the presentation format, paging, etc. Controller (the control layer): Servlet receives the user input in pages and executes the relevant transaction (calling the corresponding EJB modules), then gives the results to the relevant View, so JSP can present these results. This mech

26、anism of JSP Model 2 basically meets the developers requirements to detach the Web application transaction logic from the user interface. But some limits still exist. For example, although JSP Model 2 has implemented the basic idea of the MVC design pattern, the relationship of these three layers (S

27、ervlet, JavaBean/EJB and JSP) is still close. Especially the Servlet, which acts as the Controller, not only controls the selection and call of Models modules, but also is responsible for transferring data provided by modules to the corresponding JSP to handle. Because of this process, Servlet has t

28、o implement very complicated transaction logic by itself, which is a tough problem for the system development and maintenance. Thus, in the following Web application system frame, we will further divide the functions of the Controller.3. Solution As show in Figure 2, this system frame contains three

29、 kernel control objects/classes (SYSController, Model Center, and LPM (Logical Page Module) Center) and their own kernel database (system description database, model database, and LPM database). These three control objects/classes are divided from the raw Controller. Using these control objects/clas

30、ses and databases, the following parts of this paper will explain the design idea and implementation mechanism of this system frame. Firstly, we consider the SYSController and the System Description Database. They are responsible for receiving the user requests and searching the relevant transaction

31、 logic according to these requests. The System Description Database can be a XML2 file or a set of XML files. This database describes the different transaction logic related to different user requests one by one. The transaction logics mainly include the interactive mode, data sources, and error handling, etc. They are organized in a tree structure. The SYSController searches the System Description Database. It combines the user requests and the transactio

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1