MVC设计模式介绍毕业论文外文翻译

上传人:pu****.1 文档编号:431203889 上传时间:2024-02-02 格式:DOC 页数:5 大小:35.02KB
返回 下载 相关 举报
MVC设计模式介绍毕业论文外文翻译_第1页
第1页 / 共5页
MVC设计模式介绍毕业论文外文翻译_第2页
第2页 / 共5页
MVC设计模式介绍毕业论文外文翻译_第3页
第3页 / 共5页
MVC设计模式介绍毕业论文外文翻译_第4页
第4页 / 共5页
MVC设计模式介绍毕业论文外文翻译_第5页
第5页 / 共5页
亲,该文档总共5页,全部预览完了,如果喜欢就下载吧!
资源描述

《MVC设计模式介绍毕业论文外文翻译》由会员分享,可在线阅读,更多相关《MVC设计模式介绍毕业论文外文翻译(5页珍藏版)》请在金锄头文库上搜索。

1、 技术简介1. MVC设计模式介绍MVC模式是“Model-View-controller”的缩写,中文翻译为“模式-试图-控制器”。MVC应用程序总是由这三个部分组成。Event导致Controller改变Model或View,或者同时改变两者。只要Controller改变了Models的数据或者属性,所有依赖的View都会自动更新。类似的,重要Controller改变了View,View会从潜在的Model中获取数据来刷新自己。MVC模式最早是smalltalk语言研究团提出的,应用于交互应用程序中。Java语言是面向对象语言,很自然的SUN在应用程序事例中就推荐MVC模式作为开发Web应

2、用的架构模式。MVC模式是一种架构模式,其实需要其他模式协作完成。在J2EE模式目录中,通常采用service to worker模式是新,而service to worker模式可由集中控制器模式,派遣器模式和Page Helper模式组成。2. Struts2简介虽然Struts2号称是一个全新的框架,但这仅仅是相对Struts1而言。Struts2与Struts1相比,确实有很多革命性的改进,但它并不是新发布的新框架。从某种程度上来讲,Struts2没有继承Struts1的血统,而是继承WebWork的血统。Struts2是WebWork的升级,而不是一个全新的框架,因此稳定性、性能等各

3、方面都有很好的保证:而且吸收了Struts1和WebWork两者的优势。Struts2 Action类可以实现一个Action接口,也可实现其他接口,使可选和定制的服务成为可能。Struts2提供一个ActionSupport基类去实现 常用的接口。Action接口不是必须的,任何有execute标识的POJO对象都可以用作Struts2的Action对象。Struts2 Action对象为每一个请求产生一个实例,因此没有线程安全问题。实际上,servlet容器给每个请求产生许多可丢弃的对象,并且不会导致性能和垃圾回收问题。Struts2 Action可以通过初始化、设置属性、调用方法来测试,

4、“依赖注入”支持也使测试更容易。Struts2直接使用Action属性作为输入属性,消除了对第二个输入对象的需求。输入属性可能是有自己(子)属性的rich对象类型。Action属性能够通过web页面上的taglibs访问。Struts2也支持ActionForm模式。rich对象类型,包括业务对象,能够用作输入/输出对象。这种ModelDriven特性简化了taglib对POJO输入对象的引用。Struts2可以使用JSTL,但是也支持一个更强大和灵活的表达式语言“Object Graph Notation Language”(OGNL)。Struts2使用 “ValueStack”技术,使t

5、aglib能够访问值而不需要把你的页面(view)和对象绑定起来。ValueStack策略允许通过一系列名称相同但类型不同的属性重用页面(view)。Struts2使用OGNL进行类型转换。提供基本和常用对象的转换器。附录2Technical Overview1. MVC design pattern descriptionMVC pattern is Model-View-controller of the acronym, the Chinese translation for mode - trying to - Controller. MVC applications are alwa

6、ys by these three components. Event (events) result in Model or Controller to change the View, or to change both at the same time. Models change as long as the Controller of the data or attributes, all depend on View is updated automatically. Similarly, the important Controller changed the View, Vie

7、w of the Model from the potential to obtain data to refresh themselves. MVC pattern was first made smalltalk language research group applied to interactive applications. Java language is object-oriented language, it is natural that in the application instances SUN recommending MVC model as a framewo

8、rk for developing Web application model. MVC model is an architectural pattern, in fact, other models need to be completed in collaboration. In the J2EE pattern catalog are commonly used service to worker pattern is new, and the service to worker pattern may be focused on control mode, sending mode

9、and the Page Helper pattern.2. Struts2 IntroductionAlthough the claims is a new Struts2 framework, but it is only in terms of relative Struts1. Struts2 with Struts1 than there are indeed many revolutionary improvements, but it is not a new release of the new framework, but in another prominent frame

10、work: WebWork developed on the basis of the. To some extent, Struts2 does not inherit Struts1s ancestry, but the succession WebWork lineage. Struts2 is the WebWork upgrade, rather than an entirely new framework, therefore the stability, performance and other areas have a very good assurance: it abso

11、rbed the advantages of both Struts1 and WebWork, therefore, is a very worth the wait framework.Struts2 Action class can implement an Action interface and other interfaces can also be achieved to enable optional and custom services possible. Struts2 provides a ActionSupport to achieve common base cla

12、ss interface. Action interface is not necessary, any POJO object execute identity can be used as an object Struts2 in Action. Struts2 Action object for each instance of a request to generate a, there is no thread-safety problems. (In fact, servlet containers generate many for each request can be dis

13、carded objects, and will not lead to performance and garbage collection issues). Struts2 Action does not depend on the container, allowing Action out of the container to be tested separately. If necessary, Struts2 Action can still access the original Request and Response, however, other elements to

14、reduce or eliminate direct access to HttpServetRequest and HttpServletResponse necessary. Struts2 Action can be initialized, set properties, call methods to test, dependency injection support also makes testing easier. Struts2 using the Action attribute directly as input properties, eliminating the

15、need for the second input object needs. Input properties may have their own (sub) attribute the rich object type. Action properties able to access web pages on the taglibs. Struts2 also supports the ActionForm pattern. rich object types, including business objects, can be used as input / output objects. This ModelDriven feature simplifies the taglib reference to the POJO input objects.1

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 大杂烩/其它

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号