




版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、精选优质文档倾情为你奉上精选优质文档倾情为你奉上专心专注专业专心专注专业精选优质文档倾情为你奉上专心专注专业本科生毕业设计 (论文)外 文 翻 译 原 文 标 题 MVC Design Pattern for the multi framework distributed applications using XML, spring and struts framework 译 文 标 题 使用XML,Spring和struts以MVC为设计模式的多 分布式应用程序框架 作者所在系别 计算机与遥感信息技术学院 作者所在班级 B12511 作 者 姓 名 王硕 作 者 学 号 指导教师姓名 耿炎
2、 指导教师职称 院长 完 成 时 间 2015 年 1 月 北华航天工业学院教务处制译文标题使用XML,Spring和struts以MVC为设计模式的多分布式应用程序框架原文标题MVC Design Pattern for the multi frameworkdistributed applications using XML, spring and struts framework作 者Praveen Gupta译 名普利文古塔国 籍印度原文出处 International Journal on Computer Science and Engineering使用XML,Spring和st
3、ruts以MVC为设计模式的多分布式应用程序框架摘要:模型-视图-控制器(MVC)是一个基本的设计模式,用来分离用户界面与业务的逻辑。近些年来,应用程序的规模越来越大,而MVC设计模式可以弱耦合不同应用层的程序。本文提出了一种基于J2EE平台上的网络,它扩展了MVC、XML的应用程序框架,易于维护。这是一个包括表示层、业务层、数据持久层和数据库层的多系统层,由于其代码的具有独立性,可维护性和可重用性大大提升。在本文中,我们使用MVC实现spring和struts框架。我们的研究显示,应用多个框架设计应用程序时,使用MVC概念能使应用程序转变为更容易、较单一的框架。关键字:MVC,Spring,
4、XML 一 介绍 近些年来,web是非常复杂的问题。因为公司和组织越来越多,不同类型的通讯设备也越来越多,特别当业务要求应用程序使用web和许多通信设备的时候,网络编程的性能越加重要。所以在互联网上,在增加负载的数据的同时,我们必须照顾体系结构的问题。让我们简要讨论到目前为止MVC的研究。 1.1没有MVC 在web开发的初始阶段,页面被用来设计html,其中Html是纯文本。这是第一个在互联网上工作的标记语言。今天仍然是基于块的所有互联网的编程语言。用户必须实现与静态页面交互,信息手动写在页面时必须改变。随着时间增长,语言和页面可以按照用户需求相互作用,页面也会有相应的变化。 1.2 MVC
5、模式一 第一个重大变化是由于架构的流行,引入了MVC模式。这种具有控制演示、业务逻辑和流程的架构是以页面为中心,以Java语言为服务器的页面程序。逻辑就是在这个模型概念中介绍的。Java bean和scriptlet、表达式等业务逻辑都是以硬性编码的形式存在的。页面里的所有代码都是用jsp编写的。让我们假设,我们想传输基于我们收到数据时的jsp的情况。图一 页面导航MVC-1框架 1.3 MVC模式二 模型1架构能够解决一些网络和网络编程的问题,但仍有很多东西丢失。它是集中jsp页面的导航,从而能进一步发展的体系结构的观点。在这个过程中未来发展是Model 2架构。这个解决了一起使用Servl
6、et和JSP的问题。能够服务处理初始请求和部分处理数据。它设置bean然后结果转发到一个jsp页面。Servlet决定从列表中显示一个页面到页面。图二 MVC-2框架在这个模型中2架构的JSP页面仅用于演示目的。业务逻辑已经从页面删除。这使页面更容易表示并且轻、重量级页面也很容易在互联网上显示。 在这个模型中所有的控制和应用程序逻辑都由Servlet处理。Servlet是用java编程语言编写的,所以它也是容易处理的Servlet的一部分。在这种情况下的服务成为全面完整的应用程序,它已成为应用程序的中心点。 在model 2架构中,Servlet成为所有常见任务的“看门人”。它提供了诸多公共服
7、务,如身份验证、授权、错误控制和应用程序的循环。此体系结构解决了大部分的问题。但仍有许多新的问题出现在这个应用架构。二 应用架构与多个框架 在越来越多的网络和互联网领域,应用程序的需求正在增长。单独的一个框架是不能处理应用程序的体系结构的需求的。满足潮流要求的应用程序有必要设计一个完整的框架体系结构。 Struts框架设计和web应用程序的前端控制开发有着密不可分的联系。它为用户提供了各种功能交互的应用程序。它也遵循MVC 2设计特点。Spring框架是用来设计处理各种任务的。Spring的工作是基于互联网的应用程序。它遵循的原则MVC 2。 同时使用Struts和spring框架在单个应用程
8、序应使用MVC设计主体,这样我们可以提高应用程序的性能。 Struts框架包括三个主要模块,简要描述如下:图三 Struts框架 第一个是使用块控制,以用来表示完整的模型的一部分。它包含自定义标记库,为我们编写JSP的特定应用程序提供了国际化资源文件。第二块是代表控制器。它是导航的完整应用程序,包含XML配置文件和含标签的导航路径。 第三块是模型。这部分工作主要是分析业务逻辑,抓取和存储数据到数据库中。它包含Java bean、 Enterprise和数据库。下图显示了struts框架中的组件工作。图一 struts框架组件 Struts中的MVC 在Spring框架中,MVC的主要表现在以下
9、三个部分。控制器,Servlet控制器(部分);Java服务器页面(视图部件);应用程序业务逻辑,应用程序的形式(模型)。 Spring组件 在Spring里,我们也遵循MVC的原则。它被设计为基于互联网和桌面的应用程序。Spring包含三个核心组件。1,控制器:处理导航逻辑和交互与服务的业务逻辑层2,模型:控制器和视图之间的联系,包含由控制器渲染的视图和其所需的数据3,视图:根据用户请求,呈现从模型中获取数据。spring MVC核心组件如下。 1.DispatcherServlet:Spring的前端控制器实现。它是控制器进行交互的第一个请求。我们也可以说它是一个Servlet的实现。它控
10、制应用程序的完整流程。 2.控制器:用户创建的组件来处理请求封装导航逻辑代表服务对象的业务逻辑。 3.视图:负责渲染输出。不同的视图可以在查看设备的基础上,选择不同类型的通信设备和输出结果。 ModelAndView:ModelAndView是spring框架的核心部分。它实现了应用程序的业务逻辑。它是由控制器控制。每当它执行时,都会存储业务逻辑和与之关联的视图。 ViewResolver:根据返回的结果,输出显示收到的ModelAndView。由逻辑视图名称映射到实际的视图是由它实现的。这部分标识时实现输出媒体是什么,以及如何显示该媒体。 HandlerMapping:该接口使用Dispat
11、cherServlet传入的请求映射到单个控制器。它标识请求,并调用相应的处理程序提供的服务。 下面的图显示了模型的作用。在这个dispatcher Servlet应用程序的入口点,Struts部分作为框架,而dispatcher Servlet用于发送请求。Servlet决定处理程序。那么它将调用控制器,控制器执行ModelAndView。图5 序列流应用程序的spring框架三 提出的方法 这种方法的组合应用为两个框架,struts和spring应用程序开发打下了基础。序列图的组合应用程序解释如上所述,这是应用程序的主要驱动力。要想使用这种方法,web应用程序的基本知识是必要的。我们已经测
12、试了上述概念,找出它优点,上述体系结构的主要优点如下: 1.它将提供一个非常简洁的部分之间的行动,行动的形式,控制器,处理器,javabean模型和视图。 2.我们使用的优势是Spring MVC非常灵活。不像Struts,这迫使你的行动和表单对象具体的继承。 3.Spring MVC是完全基于接口。Spring MVC框架的每一部分是可配置的。 4.它提供了控制器,使其易于从用户界面处理的请求。 5.我们可以使用JSP或任何其他技术来显示视图,给用户的任何输出设备输出结果视图。 6.Spring配置控制器通过控制反转。这使其他对象由spring集成,于是它们更易于测试。 7.Spring M
13、VC web层Struts web层相比,由于避免强迫继承和显式依赖dispatcher Servlet控制器,Spring MVC相对更好一些。 8.web层变成了薄层上的一个业务对象层,这鼓励良好的实践。 9.Struts框架的目的仅用于设计web界面。spring框架则是开发的桌面和网络应用程序。当两个框架结合,他的灵活性则将体现出来。四 总结 相比于单一框架,多框架体系结构更有效。为了发展的大规模应用程序,我们可以使用大规模的机械、提高大型数据库应用程序的性能,比如请求数量,请求处理的能力。多框架体系结构还将为公司和程序员开放新的范围和新的商业机会。所以建议使用多个框架以便能有更好的性
14、能。由于框架代码结构过大,在此我们不予显示。五 未来研究 开放技术是吸引学术和研究学者的最好的方法。由于开放技术,现在是J2EE的广阔领域。技术的变化也使得架构不断的变化。有许多的框架可以使用J2EE技术,单独的某一个架构是从来不可能完成大规模的应用程序的。我们将努力工作,从而进一步实现和加强MVC架构。参考文献:1 Shu-qiang Huang, Huan-ming Zhang, ” Research on Improved MVC Design Pattern Based on Struts and XSL” , in Information Science and Engineerin
15、g ISISE 08 International Symposium on, 2008, vol. 1 PP. 451 4552 Juanjuan Yan; Bo Chen; Xiu-e Gao, Le Wang; Research of Structure Integration Based on Struts and Hibernate , in 2009 WRI World Congress on Computer Science and Information Engineering,2009, vol. 7,PP. 530-5343 Wojciechowski, J.; Sakowi
16、cz, B.; Dura, K.; Napieralski, A.,MVC model, struts framework and file upload issues in web applications based on J2EE platform, in Proceedings of the International Conference on Modern Problems of Radio Engineering, Telecommunications and Computer Science 2004, 2004, PP 342-3454 Erxiang Chen; Mingh
17、ui Liu, Research and Design on Library Management System Based on Struts and Hibernate Framework, in WASE International Conference on Information Engineering ICIE 09, 2009, Vol. 2,PP. 310-3135 Yonglei Tao; Component- vs. application-level MVC architecture, in Frontiers in Education 2002 FIE 2002. 32
18、nd Annual,2002, Vol 1,PP. T2G-7 - T2G-106 Meiyu Fang, Design and Implement of a Web Examination System Using Struts and EJB ,Seventh International Conference on in Web-based Learning 2008, 2008,pp. 25-287 Wang Ning; Li Liming; Wang Yanzhang; Wang Yi-bing; Wang Jing,Research on the Web Information Sy
19、stem Development Platform Based on MVC Design Pattern,in IEEE/WIC/ACM International Conference on Web Intelligence and Intelligent Agent Technology, 2008 , Vol 3,pp. 203-206作者简介 Praveen古普塔是,印度,那格浦尔那格浦尔大学电子工程工程学士,他掌握技术在信息技术从印度旁遮普大学。他在印度孟买一家软件公司担任技术主管。他是计算机电子和电气工程师协会(美国节能经济委员会)的一个研究学者,追求印度拉贾斯坦邦Pacheri
20、巴里Singhania大学的博士学,。他的主要研究兴趣包括:MVC,Java设计模式和框架。 Govil获得了博士学位。他的工作是印度阿杰梅尔女性工程学院的教授和政府负责人。他有超过20年的教育和研究经验并且已经发表了很多篇论文。他的研究兴趣包括通信、网络技术、软件工程等。附件(外文原文)MVC Design Pattern for the multi framework distributed applications using XML, spring and strutsPraveen GuptaResearch Scholar, Singhania UniversityPacheri
21、Bari, Rajasthan, India Abstract The model view controller (MVC) is a fundamental design pattern for the separation between user interface logic and business logic. Since applicationsare very large in size these days and the MVC design pattern can weak the coupling among the different application tie
22、rs of application. this paper presents a web application framework based on MVC in J2EE platform, and extends it with XML so that the framework is more flexible, expansible and easy to maintain. This is a multitier system including presentation layer, business layer, data persistence layer and datab
23、ase layer. This separate codes, and improve maintainability and reusability of the application. In this paper, we implemented MVC using spring and struts framework. Our research study show that applying multiple framework to design the applications using MVC concepts makes applications easier compar
24、e to a single framework.Index Terma: MVC, Spring, XMLI. INTRODUCTION Web is the very complex issues these days. Since the desire of the companies and organizations are increasing so the complexity and the performance of the web programming matters. Complexity with the different types of communicatio
25、n devices is increasing. The business is demanding applications using the web and many communication devices. So with the increase load of the data on the internet we have to take care of the architecture issue. Let us discuss in brief the research done so far in MVC. 1. 1 NO MVC : In The initial ph
26、ase of the web development the pages were used to be designed in the html. Html is the plain text only. This was the first markup language which can work on the internet. And today stills it works as building block for the all Internet based programming languages. The user has to interact with the s
27、tatic pages. The information written on the pages had to change manually. As the time grows the demand arises for a language that can interact with the user and page can be changed as per the requirement of the user.1.2 MVC Model 1: The first major change in the architecture comes with the introduct
28、ion of the MVC Model 1 Architecture. This architecture was completely based on the page centric approach. In this model a Java Server Pages to program to control the Presentation, Business Logic and flow of the program. In this model the concept of the Business Logic was introduced. The business log
29、ic was hard coded in the form of the Java Beans and scriptlets and expressions. All this codes was used to write within the JSP page. Let us assume a case when we want to transfer the flow of the jsp application based on the data we received from the input. 1.3 MVC Model 2 : The model 1 architecture
30、 was able to solve some of the problem of the web and internet programming but still there were a lot of things missing from it. It was centered on the navigation of the jsp pages so there was the scope of the further development in the architecture point of view. During this process the next develo
31、pment was the Model 2 architecture. This problem was solved using the Servlet and JSP together. The Servest handles the Initial request and partially process the data. It set up the beans then forward the result to the one of the jsp page. The Servlet decide the one of the page to be displayed from
32、the list of pages. In this Model 2 architecture the JSP Pages were used toPresentation purpose only.The Business logic has beenremoved from the page.This makes the pages easier torepresent and light weight pages which were easy to displayon the internet. In this model all Control and application log
33、ic were handledby the Servlet.The Servlet was written in the javaprogramming language.So it was also easier to handle theprogramming part of the Servlet.In this scenario the Servestbecomes the power full for the complete application and It hasemerged as the center point for the application. In the m
34、odel 2 architecture the Servlet becomes the gatekeeperfor the all common tasks.It provides the common services likeauthentication, authorization, error control and follow of theapplication.This architecture have solved the most of theproblems.But still there were many new issues emerged whileapplyin
35、g this architecture.II.APPLYING ARCHITECTURE WITH MULTIPLEFRAMEWORKS Web and Internet is ever growing area and the demands for theapplications are growing.A single framework is not capable tohandle the architecture of the application.To meet thecurrents requirement of the applications its necessary
36、todesign a architecture to implement the frameworks. Struts framework have been designed and developed for thefront end control of the web applications.It provides thevarious features for the applications that interact to the users.It also follows the MVC 2 design features. Spring Framework is the d
37、esigned to handle the various tasks.The spring work for the desktop and internet basedapplications also.It follows the principals of the MVC 2.The simultaneous use of the Struts and spring frameworks inthe single application with the applying the MVC Designprincipals so that we can Improve the perfo
38、rmance of theapplications. Struts Framework consists of three major blocks, Described inbrief as follows: First is The View Block which controls the presentation partof the complete model.This contains followingJSP files which you write for your specific applicationSet of JSP custom tag libraries Re
39、source files forinternationalization. Second Block is representing the Controller.This is fornavigation the complete application.This contains XMLconfiguration files; it contains the tags for the navigation ofthe paths. Third Block is the Model.This part do the work of theBusiness Logic, Fetching an
40、d storing data to the database.This contains following Java Beans Enterprise Java BeansDatabase.Following figure shows the working of thecomponents in the struts framework. MVC in Struts The major three parts of the MVC are as follows in the springframework.Servlet controller (Controller Part)Java S
41、erver Pages or any other presentation technology (ViewPart)Application Business Logic: in the form of whatever suits theapplication (Model Part). SpringComponents. In the spring we also follows the principals of the MVC .Ithas been designed more for the desktop and internet basedapplications.Spring
42、consist of three core collaboratingcomponents.1.Controller: Handles navigation logic andinteracts with the Service tier for business logic2.Model: The contract between the Controller and the ViewContains the data needed to render the ViewPopulated by the Controller 3.View: Renders the response tothe
43、 request Pulls data from the model. Core components in the spring MVC are as follows. DispatcherServlet: Springs Front Controller implementation.It is the first controller which interacts to the requests.We canalso say it is an implementation of the Servlet.It controls thecomplete flow of the applic
44、ation. 2.Controller: User created component for handling requestsencapsulates navigation logic delegates to the service objectsfor business logic. 3.View: Responsible for rendering output.Different viewscan be selected for the different types of output bases on theresults and the viewing device, com
45、munication devices. 4.ModelAndView: ModelAndView is the core part of thespring framework.It implements the business logic of theapplication.It is controlled by the controller.It stores thebusiness logic and the view associated with it.Whenever it isexecuted it will the data with the name of the view
46、. 5.ViewResolver: How the output is to be displayed dependson the result received from ModelAndView.It is used to maplogical view names to actual view implementations.This partidentifies and implement what is the output media and how todisplay it. 6.HandlerMapping: Strategy interface used byDispatch
47、erServlet for mapping incoming requests to individualControllers.It identifies the request and calls the respectivehandler to provide the services. The following figure shows how the model will work.In thisthe dispatcher Servlet is the entry point for the application.The Struts parts do its work and
48、 send the request to thedispatcher Servlet.The Servlet decides the handler.Then itwill call to the controller.Controller will execute theModelAndView.III. PROPOSED METHODOLOGY This approach is based a combination of applying thetwo framework struts and spring for the applicationdevelopment.The seque
49、nce diagram for the combinedapplication is explained as above, which is the maindriving force for the application.This approach assumesthat basic knowledge of web applications is essential.We have tested the above concepts and find out itsuccessfully.Major benefits of the above architectureare as fo
50、llows. It will provide a very clean division between actions,action forms, controllers, handlers, JavaBeans models,and views. 2.Springs MVC is very flexible.Unlike Struts, thisforces your Action and Form objects into concreteinheritance.We are using advantage of both. 3.SpringMVC is entirely based o
51、n interfaces.Every part of theSpring MVC framework is configurable. 4.It provides controllers, making it easy to handling ofmany requests from User Interface. 5.We can use JSP or Any other Technology to displaythe view, results to the user on the any of the outputdevice. 6.Spring Controllers are con
52、figured via Inversion ofControls.This makes them easy to test and integratedwith other objects managed by spring. 7.Spring MVC web tiers are typically easier to test ascompared to Struts web tiers, due to the avoidance offorced concrete inheritance and explicit dependence ofcontrollers on the dispat
53、cher Servlet. 8.The web tier becomes a thin layer on top of a businessobject layer.This encourages good practice. 9.Struts framework was designed for the web interfacepurpose only.The spring framework was developed forthe desktop and internet applications.When both frameworks used as combined it wil
54、l provide theflexibility of implementation.IV. CONCLUSION Multiple framework architecture works better as compare toany single framework architecture.With the effective of themultiple frameworks for the development of the large scaleapplications we can improve the performance of the LargeDatabase ap
55、plication in terms handling number of requests,processing ability and maximum use of the machinery.It willalso open the new scope and new business opportunities forthe companies and the programmers.Its recommended to usethe multiple frameworks for the Better performance.Due tolarge size of java code
56、 I am unable to provide it here.V FUTURE RESERCH Open technologies are the best to attract the academic andresearch scholar to work.J2EE is the vast field now a day, itsopen technologies also.Architecture is never fixed its goeson changing with the change in the technology.There aremany frameworks a
57、vailable to work with J2EE technologies,Single frame is never sufficient to provide the completesolution with all essential features of the application.There isa lot of scope to work further with many other frameworks toimplement and enhance the MVC architecture.REFERENCES1 Shu-qiang Huang, Huan-min
58、g Zhang, ” Research on Improved MVC Design Pattern Based on Struts and XSL” , in Information Science and Engineering ISISE 08 International Symposium on, 2008, vol. 1 PP. 451 4552 Juanjuan Yan; Bo Chen; Xiu-e Gao, Le Wang; Research of Structure Integration Based on Struts and Hibernate , in 2009 WRI
59、 World Congress on Computer Science and Information Engineering,2009, vol. 7,PP. 530-5343 Wojciechowski, J.; Sakowicz, B.; Dura, K.; Napieralski, A.,MVC model, struts framework and file upload issues in web applications based on J2EE platform, in Proceedings of the International Conference on Modern Problems of Radio Engineering, Telecommunications and Compu
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2025届中国燃气校园招聘正式启动笔试参考题库附带答案详解
- 保证函和保证合同范本
- 加工产品企业合同范本
- 养殖买卖合同范例
- 农村购墓地合同范本
- 介绍股合同范本
- 劳动聘用合同范本
- 亲兄弟合伙合同范本
- pe管材购销合同范本
- 亏损分担合同范例
- 2025人教版一年级下册数学教学进度表
- DeepSeek教案写作指令
- 休学复学申请书
- 瓷砖铺贴劳务承包协议书
- 2025年四川司法警官职业学院高职单招职业适应性测试近5年常考版参考题库含答案解析
- 新建污水处理厂工程EPC总承包投标方案(技术标)
- 山东省德州市2024-2025学年高三上学期1月期末生物试题(有答案)
- 《宏观经济管理研究》课件
- 本人报废车辆委托书
- 双减政策与五项管理解读
- 2025年道德与法治小学六年级下册教学计划(含进度表)
评论
0/150
提交评论