




版權說明:本文檔由用戶提供并上傳,收益歸屬內容提供方,若內容存在侵權,請進行舉報或認領
文檔簡介
1、本科生畢業設計 (論文)外 文 翻 譯 原 文 標 題 MVC Design Pattern for the multi framework distributed applications using XML, spring and struts framework 譯 文 標 題 使用XML,Spring和struts以MVC為設計模式的多 分布式應用程序框架 作者所在系別 計算機與遙感信息技術學院 作者所在班級 B12511 作 者 姓 名 王碩 作 者 學 號 20124051117 指導教師姓名 耿炎 指導教師職稱 院長 完 成 時 間 2015 年 1 月 推薦精選 北華航天工業學
2、院教務處制推薦精選譯文標題使用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和struts以MVC為設計模式的多分布式應用程序框架摘要:
3、模型-視圖-控制器(MVC)是一個基本的設計模式,用來分離用戶界面與業務的邏輯。近些年來,應用程序的規模越來越大,而MVC設計模式可以弱耦合不同應用層的程序。本文提出了一種基于J2EE平臺上的網絡,它擴展了MVC、XML的應用程序框架,易于維護。這是一個包括表示層、業務層、數據持久層和數據庫層的多系統層,由于其代碼的具有獨立性,可維護性和可重用性大大提升。在本文中,我們使用MVC實現spring和struts框架。我們的研究顯示,應用多個框架設計應用程序時,使用MVC概念能使應用程序轉變為更容易、較單一的框架。關鍵字:MVC,Spring,XML 一 介紹 近些年來,web是非常復雜的問題。因
4、為公司和組織越來越多,不同類型的通訊設備也越來越多,特別當業務要求應用程序使用web和許多通信設備的時候,網絡編程的性能越加重要。所以在互聯網上,在增加負載的數據的同時,我們必須照顧體系結構的問題。讓我們簡要討論到目前為止MVC的研究。 1.1沒有MVC 在web開發的初始階段,頁面被用來設計html,其中Html是純文本。這是第一個在互聯網上工作的標記語言。今天仍然是基于塊的所有互聯網的編程語言。用戶必須實現與靜態頁面交互,信息手動寫在頁面時必須改變。隨著時間增長,語言和頁面可以按照用戶需求相互作用,頁面也會有相應的變化。 1.2 MVC模式一 第一個重大變化是由于架構的流行,引入了MVC模
5、式。這種具有控制演示、業務邏輯和流程的架構是以頁面為中心,以Java語言為服務器的頁面程序。邏輯就是在這個模型概念中介紹的。Java bean和scriptlet、表達式等業務邏輯都是以硬性編碼的形式存在的。頁面里的所有代碼都是用jsp編寫的。讓我們假設,我們想傳輸基于我們收到數據時的jsp的情況。圖一 頁面導航MVC-1框架 1.3 MVC模式二 模型1架構能夠解決一些網絡和網絡編程的問題,但仍有很多東西丟失。它是集中jsp頁面的導航推薦精選,從而能進一步發展的體系結構的觀點。在這個過程中未來發展是Model 2架構。這個解決了一起使用Servlet和JSP的問題。能夠服務處理初始請求和部分
6、處理數據。它設置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框架在單個應用程序應使用MVC設計主體,這樣我們可以提高應用程
8、序的性能。 Struts框架包括三個主要模塊,簡要描述如下:推薦精選圖三 Struts框架 第一個是使用塊控制,以用來表示完整的模型的一部分。它包含自定義標記庫,為我們編寫JSP的特定應用程序提供了國際化資源文件。第二塊是代表控制器。它是導航的完整應用程序,包含XML配置文件和含標簽的導航路徑。 第三塊是模型。這部分工作主要是分析業務邏輯,抓取和存儲數據到數據庫中。它包含Java bean、 Enterprise和數據庫。下圖顯示了struts框架中的組件工作。圖一 struts框架組件 Struts中的MVC 在Spring框架中,MVC的主要表現在以下三個部分。控制器,Servlet控制器
9、(部分);Java服務器頁面(視圖部件);應用程序業務邏輯,應用程序的形式(模型)。推薦精選 Spring組件 在Spring里,我們也遵循MVC的原則。它被設計為基于互聯網和桌面的應用程序。Spring包含三個核心組件。1,控制器:處理導航邏輯和交互與服務的業務邏輯層2,模型:控制器和視圖之間的聯系,包含由控制器渲染的視圖和其所需的數據3,視圖:根據用戶請求,呈現從模型中獲取數據。spring MVC核心組件如下。 1.DispatcherServlet:Spring的前端控制器實現。它是控制器進行交互的第一個請求。我們也可以說它是一個Servlet的實現。它控制應用程序的完整流程。 2.控
10、制器:用戶創建的組件來處理請求封裝導航邏輯代表服務對象的業務邏輯。 3.視圖:負責渲染輸出。不同的視圖可以在查看設備的基礎上,選擇不同類型的通信設備和輸出結果。 ModelAndView:ModelAndView是spring框架的核心部分。它實現了應用程序的業務邏輯。它是由控制器控制。每當它執行時,都會存儲業務邏輯和與之關聯的視圖。 ViewResolver:根據返回的結果,輸出顯示收到的ModelAndView。由邏輯視圖名稱映射到實際的視圖是由它實現的。這部分標識時實現輸出媒體是什么,以及如何顯示該媒體。 HandlerMapping:該接口使用DispatcherServlet傳入的請
11、求映射到單個控制器。它標識請求,并調用相應的處理程序提供的服務。 下面的圖顯示了模型的作用。在這個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 MVC web層Stru
13、ts 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 Engineering ISISE 08
15、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.; Sakow
16、icz, 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 Erxian
17、g Chen; Minghui 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 Fro
18、ntiers in Education 2002 FIE 2002. 32nd 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-b
19、ing; Wang Jing,"Research on the Web Information System 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古普塔是,印度,那格浦爾那格浦爾大學電子工程工程學士,他掌握技術在信息技術從印度旁遮普大學。他在印度
20、孟買一家軟件公司擔任技術主管。他是計算機電子和電氣工程師協會(美國節能經濟委員會)的一個研究學者,追求印度拉賈斯坦邦Pacheri巴里Singhania大學的博士學,。他的主要研究興趣包括:MVC,Java設計模式和框架。 Govil獲得了博士學位。他的工作是印度阿杰梅爾女性工程學院的教授和政府負責人。他有超過20年的教育和研究經驗并且已經發表了很多篇論文。他的研究興趣包括通信、網絡技術、軟件工程等。推薦精選附件(外文原文)MVC Design Pattern for the multi framework distributed applications using XML, spring
21、and strutsPraveen GuptaResearch Scholar, Singhania UniversityPacheri Bari, Rajasthan, Indiapraveen2gupta 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 an
22、d the MVC design pattern can weak the coupling among the different application tiers 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 sys
23、tem including presentation layer, business layer, data persistence layer and database 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 framew
24、ork to design the applications using MVC concepts makes applications easier compare 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 o
25、f the web programming matters. Complexity with the different types of communication 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
26、 discuss in brief the research done so far in MVC. 1. 1 NO MVC : In The initial phase 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
27、 the all Internet based programming languages. The user has to interact with the static 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.推薦
28、精選1.2 MVC Model 1: The first major change in the architecture comes with the introduction 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 pro
29、gram. In this model the concept of the Business Logic was introduced. The business logic 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 ba
30、sed on the data we received from the input. 1.3 MVC Model 2 : The model 1 architecture 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 furt
31、her development in the architecture point of view. During this process the next development 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
32、 the one of the jsp page. The Servlet decide the one of the page to be displayed from the list of pages. 推薦精選 In this Model 2 architecture the JSP Pages were used to Presentation purpose only. The Business logic has been removed from the page. This makes the pages easier to
33、represent and light weight pages which were easy to display on the internet. In this model all Control and application logic were handled by the Servlet. The Servlet was written in the java programming language. So it was also easier to handle the programming part of th
34、e Servlet. In this scenario the Servest becomes the power full for the complete application and It has emerged as the center point for the application. In the model 2 architecture the Servlet becomes the gatekeeper for the all common tasks. It provides the common services li
35、ke authentication, authorization, error control and follow of the application. This architecture have solved the most of the problems. But still there were many new issues emerged while applying this architecture.II. APPLYING ARCHITECTURE WITH MUL
36、TIPLE FRAMEWORKS Web and Internet is ever growing area and the demands for the applications are growing. A single framework is not capable to handle the architecture of the application. To meet the currents requirement of the applications its necessary to design a
37、architecture to implement the frameworks. Struts framework have been designed and developed for the front end control of the web applications. It provides the various features for the applications that interact to the users. It also follows the MVC 2 design features. Spring Frame
38、work is the designed to handle the various tasks. The spring work for the desktop and internet based applications also. It follows the principals of the MVC 2.The simultaneous use of the Struts and spring frameworks in the single application with the applying the MVC Design
39、principals so that we can Improve the performance of the推薦精選 applications. Struts Framework consists of three major blocks, Described in brief as follows: First is The View Block which controls the presentation part of the complete model. This contai
40、ns following JSP files which you write for your specific application Set of JSP custom tag libraries Resource files for internationalization. Second Block is representing the Controller. This is for navigation the complete application. This contains XML confi
41、guration files; it contains the tags for the navigation of the paths. Third Block is the Model. This part do the work of the Business Logic, Fetching and storing data to the database.This contains following Java Beans Enterprise Java Beans Database. Following figure shows th
42、e working of the components in the struts framework.推薦精選 MVC in Struts The major three parts of the MVC are as follows in the spring framework. Servlet controller (Controller Part) Java Server Pages or any other presentation technology (View Part) Application Business L
43、ogic: in the form of whatever suits the application (Model Part). SpringComponents. In the spring we also follows the principals of the MVC . It has been designed more for the desktop and internet based applications. Spring consist of three core collaborating components
44、. 1. Controller: Handles navigation logic and interacts with the Service tier for business logic 2. Model: The contract between the Controller and the View Contains the data needed to render t
45、he View Populated by the Controller 3. View: Renders the response to the 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 reques
46、ts. We can also say it is an implementation of the Servlet. It controls the complete flow of the application. 2. Controller: User created component for handling requests encapsulates navigation logic delegates to the service objects for
47、0;business logic. 3.View: Responsible for rendering output. Different views can be selected for the different types of output bases on the results and the viewing device, communication devices. 4.ModelAndView: ModelAndView is the core part of the spring framework. It i
48、mplements the business logic of the application. It is controlled by the controller.推薦精選 It stores the business logic and the view associated with it. Whenever it is executed it will the data with the name of the view. 5. ViewResolver: How the output is to be displ
49、ayed depends on the result received from ModelAndView. It is used to map logical view names to actual view implementations. This part identifies and implement what is the output media and how to display it. 6. HandlerMapping: Strategy interface
50、160;used by DispatcherServlet for mapping incoming requests to individual Controllers. It identifies the request and calls the respective handler to provide the services. The following figure shows how the model will work. In this the dispatcher Servlet is the ent
51、ry point for the application. The Struts parts do its work and send the request to the dispatcher Servlet. The Servlet decides the handler. Then it will call to the controller. Controller will execute the ModelAndView.III. PROPOSED METHODOLOGY This approach is base
52、d a combination of applying the two framework struts and spring for the application development. The sequence diagram for the combined application is explained as above, which is the main driving force for the application. This approach assumes that basic knowledge
53、 of web applications is essential. We have tested the above concepts and find out it successfully. Major benefits of the above architecture are as follows. It will provide a very clean division between actions, action forms, controllers, handlers, JavaBeans models, and
54、views.推薦精選 2.Spring's MVC is very flexible. Unlike Struts, this forces your Action and Form objects into concrete inheritance. We are using advantage of both. 3.Spring MVC is entirely based on interfaces. Every part of the Spring MVC framework is configur
55、able. 4.It provides controllers, making it easy to handling of many requests from User Interface. 5.We can use JSP or Any other Technology to display the view, results to the user on the any of the output device. 6.Spring Controllers are configured via Inversion of Controls.
56、;This makes them easy to test and integrated with other objects managed by spring. 7.Spring MVC web tiers are typically easier to test as compared to Struts web tiers, due to the avoidance of forced concrete inheritance and explicit dependence of controllers on the dispatcher Ser
57、vlet. 8.The web tier becomes a thin layer on top of a business object layer. This encourages good practice. 9.Struts framework was designed for the web interface purpose only. The spring framework was developed for the desktop and internet applications. When both framew
58、orks used as combined it will provide the flexibility of implementation.IV. CONCLUSION Multiple framework architecture works better as compare to any single framework architecture. With the effective of the multiple frameworks for the development of the large scale applicati
59、ons we can improve the performance of the Large Database application in terms handling number of requests, processing ability and maximum use of the machinery. It will also open the new scope and new business opportunities for the companies and the programmers. Its recommended to use the multiple frameworks for the Better performance. Due to large size of java code I am unable to provide it here.V FUTURE RESERCH Open technologies are the best to attract the academic and research sc
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯系上傳者。文件的所有權益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網頁內容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經權益所有人同意不得將文件中的內容挪作商業或盈利用途。
- 5. 人人文庫網僅提供信息存儲空間,僅對用戶上傳內容的表現方式做保護處理,對用戶上傳分享的文檔內容本身不做任何修改或編輯,并不能對任何下載內容負責。
- 6. 下載文件中如有侵權或不適當內容,請與我們聯系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- GB/T 45828-2025共享閑置物品質量信息描述
- TD/T 1044-2014生產項目土地復墾驗收規程
- JJG(煙草)15-2010煙草專用吸阻標準棒檢定規程
- 2025學年環翠區八年級上學期歷史期末試題:中外歷史時間軸歷史人物解讀
- 化學●廣東卷丨2022年廣東省普通高中學業水平選擇性考試化學試卷及答案
- 被害人陳述38課件
- 考研復習-風景園林基礎考研試題附參考答案詳解【培優】
- 考研復習-風景園林基礎考研試題(研優卷)附答案詳解
- 風景園林基礎考研資料試題及參考答案詳解【基礎題】
- 《風景園林招投標與概預算》試題A帶答案詳解(研優卷)
- 4-02-02-01 國家職業標準客運車輛駕駛員 (2025年版)
- 2024北京西城區四年級(下)期末語文試題及答案
- 【航線補貼績效評估實證研究-以華夏航空公司為例19000字(論文)】
- 《中國老年高血壓管理指南(2023版)》解讀
- 電梯五方對講設計方案
- 24 唐詩三首 《茅屋為秋風所破歌》課件
- 2025年初一下冊語文-課內現代文復習23課.《蛟龍探海》(解析版)
- 小升初英語作文寫作專題訓練題100題(含范文詳解)
- 國際化創新型人才培養模式與中俄合作辦學實踐案例分析
- 附件6工貿高風險企業高危領域較大以上安全風險管控清單
- 一次性使用無菌醫療器械管理制度
評論
0/150
提交評論