多框架的MVC设计模式 使用XML,spring和struts的分布式应用程序框架外文翻译资料

 2022-06-05 09:06

MVC Design Pattern for the multi framework

distributed applications using XML, spring and struts

framework

Praveen Gupta ,Research Scholar, Singhania University ,Pacheri Bari, Rajasthan, India praveen2gupta@gmail.com

Prof. M.C. Govil Govt. Mahila Engineering College Ajmer, Rajasthan, India govilmc@yahoo.com

Abstract— The model view controller (MVC) is a fundamental design pattern for the separation between user interface logic and business logic. Since applications are very large in size these days and 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 multi tier system 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 framework to design the applications using MVC concepts makes applications easier compare to a single framework. Index Terma: MVC, Spring, XML

  1. 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 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 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 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.

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 program. 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 based on the data we received from the input.

Figure 1 Page Navigation in MVC -1 Architecture

    1. 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 further 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 the one of the jsp page. The Servlet decide the one of the page to be displayed from the list of pages.

Figure 2 MVC -2 architecture

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 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 the 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 like 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

APPLYING ARCHITECTURE WITH MULTIPLE 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 itrsquo;s necessary to design a 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 Framework 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 principals so that we can Improve the performance of the applications. Struts Framework consists of three major blocks, Described in brief as follows.

Figure 3 Struts Model Architecture

First is The View Block which controls the presentation part of the complete model. This contains following JSP files which you write for

剩余内容已隐藏,支付完成后下载完整资料


多框架的MVC设计模式

使用XML,spring和struts的分布式应用程序框架

Praveen Gupta,研究学者,Singhania大学,Pacheri Bari,拉贾斯坦邦,印度praveen2gupta@gmail.com

潘宗光。Mksk Govil Govt 印度拉贾斯坦邦阿杰梅尔女子工程学院Govilms@yahoo.com

摘要 - 模型视图控制器(MVC)是用户界面逻辑和业务逻辑之间分离的基本设计模式。 由于应用程序目前的规模非常大,而MVC设计模式可能会削弱不同应用程序层之间的耦合。 本文在J2EE平台上提出了一个基于MVC的Web应用框架,并用XML进行了扩展,使框架更加灵活,可扩展,易于维护。 这是一个多层系统,包括表示层,业务层,数据持久层和数据库层。 这个单独的代码,提高了应用程序的可维护性和可重用性。 在本文中,我们使用spring和struts框架实现了MVC。 我们的研究表明,使用多个框架来设计使用MVC概念的应用程序,与单个框架相比,应用程序更容易。 Index Terma:MVC,Spring,XML

  1. 引言 如今,Web是一个非常复杂的问题。 由于公司和组织的愿望在增加,因此Web编程的复杂性和性能很重要。 与不同类型的通信设备的复杂性正在增加。 该企业要求使用网络和许多通信设备的应用程序。 因此,随着互联网上数据负载的增加,我们必须处理架构问题。 让我们简要讨论迄今为止在MVC中所做的研究.

1. 1 无MVC框架: 在Web开发的初始阶段,页面用于在html中设计。 Html只是纯文本。 这是第一种可以在互联网上运行的标记语言。 今天它仍然是所有基于Internet的编程语言的构建块。 用户必须与静态页面交互。 写在页面上的信息必须手动更改。 随着时间的增长,对可以与用户交互的语言产生需求,并且可以根据用户的要求改变页面。

1.2 MVC 模型1: 该架构的第一个重大变化是MVC Model 1架构的引入。 该架构完全基于以页面为中心的方法。 在此模型中,Java Server Pages用于编程以控制程序的表示,业务逻辑和流程。 在此模型中,引入了业务逻辑的概念。 业务逻辑以Java Bean和scriptlet和表达式的形式进行了硬编码。 所有这些代码都用于在JSP页面中编写。 让我们假设一个案例,当我们想要根据我们从输入收到的数据传输jsp应用程序的流程。

图1 MVC -1架构中的页面导航

    1. MVC 模型2: 模型1架构能够解决网络和互联网编程的一些问题,但仍然有很多东西缺失。 它集中在jsp页面的导航上,因此在架构的观点上有进一步发展的范围。 在此过程中,下一个开发是Model 2架构。 使用Servlet和JSP一起解决了这个问题。 Servest处理Initial请求并部分处理数据。 它设置bean然后将结果转发到jsp页面之一。 Servlet决定从页面列表中显示的页面之一。

图2 MVC -2架构

在此Model 2体系结构中,JSP Pages仅用于演示目的。业务逻辑已从页面中删除。这使得页面更容易表示,并且轻量级页面易于在因特网上显示在该模型中,所有控制和应用程序逻辑都由Servlet处理。 Servlet是用java编程语言编写的。因此,处理Servlet的编程部分也更容易。在这种情况下,Servest成为完整应用程序的全部功能,它已成为应用程序的中心点。在模型2架构中,Servlet成为所有常见任务的守门员。它提供常见的服务,如身份验证,授权,错误控制和应用程序的跟踪。这种架构解决了大部分问题。但是在应用这种架构时仍然出现了许多新问题

将架构应用于多个框架Web和Internet正在不断发展,对应用程序的需求也在不断增长。单个框架无法处理应用程序的体系结构。为了满足应用程序的电流要求,有必要设计一个架构来实现框架。 Struts框架已经设计和开发用于Web应用程序的前端控制。它为与用户交互的应用程序提供各种功能。它还遵循MVC 2设计功能。 Spring Framework旨在处理各种任务。弹簧适用于桌面和基于互联网的应用程序。它遵循MVC 2的原则。在单个应用程序中同时使用Struts和spring框架,并应用MVC Design原理,以便我们可以提高应用程序的性能。 Struts Framework由三个主要块组成,简要描述如下。

图3 Struts模型体系结构

首先是View Block,它控制整个模型的表示部分。 这包含您为特定应用程序编写的以下JSP文件JSP自定义标记库集用于国际化的资源件

第二块代表控制器。 这是用于导航的完整应用程序。 这包含XML配置文件; 它包含用于导航路径的标签。 第三块是模型。 这部分完成了业务逻辑,获取和存储数据到数据库的工作。这包含以下Java Bean Enterprise Java Bean数据库。 下图显示了struts框架中组件的工作情况。

图4 Struts架构中的组件

Struts中的MVC MVC的主要三个部分在spring框架中如下所示。 Servlet控制器(控制器部分)Java Server Pages或任何其他表示技术(查看部分)应用程序业务逻辑:以适合应用程序的任何形式(模型部分)。 SpringComponents。在春天,我们也遵循MVC的原则。它专为桌面和基于互联网的应用程序而设计。 Spring由三个核心协作组件组成。 1.控制器:处理导航逻辑并与业务逻辑2的服务层交互。模型:Controller和View之间的契约包含呈现控制器填充的视图所需的数据3.查看:呈现对请求的响应从模型中提取数据。弹簧MVC中的核心组件如下。 1.DispatcherServlet:Spring的前端控制器实现。它是第一个与请求交互的控制器。我们也可以说它是Servlet的一个实现。它控制着应用程序的完整流程。 2.控制器:用户创建的用于处理请求的组件将导航逻辑委托封装到业务逻辑的服务对象。 3.视图:负责渲染输出。可以针对结果和观看设备,通信设备的不同类型的输出基础选择不同的视图。 4. ModelAndView:ModelAndView是spring框架的核心部分。它实现了应用程序的业务逻辑。它由控制器控制。它存储业务逻辑和与之关联的视图。每当执行它时,它将具有视图名称的数据。 5. ViewResolver:输出的显示方式取决于从ModelAndView接收的结果。它用于将逻辑视图名称映射到实际视图实现。此部分标识并实现什么是输出媒体以及如何显示它。 6. HandlerMapping:DispatcherServlet用于将传入请求映射到各个控制器的策略接口。它标识请求并调用相应的处理程序来提供服务。下图显示了该模型的工作原理。在此,调度程序Servlet是应用程序的入口点。 Struts部分可以正常工作,并将请求发送给调度程序Servlet。 Servlet决定处理程序。然后它将调用控制器。 Controller将执行ModelAndView。

图5:弹簧框架中的应用程序序列流程。

  1. 建议方式

这种方法基于应用两个框架struts和spring进行应用程序开发的组合。组合应用程序的顺序图如上所述,这是应用程序的主要驱动力。此方法假定Web应用程序的基本知识是必不可少的。我们测试了上述概念并成功找到了它。上述架构的主要优点如下。它将在动作,动作形式,控制器,处理程序,JavaBeans模型和视图之间提供非常清晰的划分。 2. Spring的MVC非常灵活。与Struts不同,这会强制您将Action和Form对象转换为具体的继承。我们正在利用两者的优势。 3. Spring MVC完全基于接口。 Spring MVC框架的每个部分都是可配置的。 4.它提供控制器,可以轻松处理来自用户界面的许多请求。 5.我们可以使用JSP或任何其他技术来显示视图,将结果显示给任何输出设备上的用户。 6.通过控制反转配置弹簧控制器。这使它们易于测试并与spring管理的其他对象集成。 7.与Struts Web层相比,Spring MVC Web层通常更容易测试,因为避免了强制具体继承和控制器对调度程序Servlet的显式依赖。 8. Web层成为业务对象层顶部的薄层。这鼓励了良好的做法。 9. Struts框架仅用于Web界面。 Spring框架是为桌面和互联网应用程序开发的。当两个框架组合使用时,它将提供实现的灵活性。 IV。结论与任何单一框架架构相比,多框架架构的工作效果更好。随着用于开发大规模应用程序的多个框架的有效性,我们可以在处理请求数量,处理能力和机器的最大使用方面提高大型数据库应用程序的性能。它还将为公司和程序员打开新的范围和新的商机。建议使用多个框架以获得更好的性能。由于java代码的大小,我无法在此提供。

Ⅲ. MyBatis上的功能架构

  1. Mybatis功能架构分为三层,即界面层,数据处理层和基础支撑层,如图1所示,描述如下[2,3]:
  2. (1)接口层:提供使用外部接口API,开发人员通过API来操纵数据库。接收层的接收层称为数据处理层,以完成特定的数据处理。 SqlSessionFactory和SqlSession是MyBatis接口层的核心,SqlSessionFactory对象由SqlSessionFactoryBuilder创建,主要功能是创建SqlSession对象; SqlSession对象的主要功能是完成数据库访问和映射,因为不是线程安全的,所以SqlSession对象需要限制方法的范围
  3. (2)数据处理层:它负责特定的SQL搜索,解析SQL,SQL执行和执行结果映射处理,主要目的是根据调用请求来完成数据库操作。,MyBatis.XML分析SqlMapConfig.xml和SqlMap.xml应用程序启动时的两个配置文件。 SqlMapConfig.xml在XMLConfigBuilder类中完成分析; SqlMapConfig.xml在XMLConfigBuilder类中完成解析,涉及PreparedMapping,ResultMapping,LanguageDriver,Discriminator,缓存和自动映射等一系列对象结构。 Executor是MyBatis的核心,具有完整的数据库操作过程,需要MappedStatement,参数和结果Handler实例对象。事务提交/回滚,委托给Transaction对象完成;缓存,创建CacheKey()/是Cached();延迟加载,延迟加载(); Close,close(),主要是事务回滚/关闭。

图6:MyBatis上的功能架构

  1. Foundation支持层:它负责最基本的功能,包括连接管理,事务管理,配置,加载和缓存处理,共享组件被提取为最基本的组件,为数据处理层提供支持的基础。 MyBatis在组织下提供了一个简单的数据源/连接池。阿帕奇。 ibatis.datasourse,实现类是PooledDataSource,包含最大连接数,最大空闲连接数,连接不足以取出等待时间最长的等等; MyBatis用于事务处理比较简单,TransactionIsolationLevel定义了几个隔离级别,不支持嵌套事务,应用程序开发,委托Spring处理事务; MyBatis包含两种缓存。 Session和Statement是作用域级别,默认是Session,BaseExecutor根据MappedStatement Id,SQL,值和CacheKey rowBound来构造,并通过使用localCache BaseExccutor缓存进行维护。全局二级缓存可以通过CacheExecutor实现,并委托TransactionalCacheManager保存或访问缓存。
  2. 本地数据库设计

数据存储上的逻辑结构设计与具体结构的数据库管理系统相关联,并选择Sybase作为课程管理系统。 Sybase数据库是在Sybase公司的高性能产品中推出的,它基于客户端/服务器架构,应用程序在多台机器上运行。优点是支持共享资源并平衡多个设备之间的负载,允许多个主机环境,充分利用企业拥有的一些不同系统。

Sybase数据库主要由三部分组成:一是用于数据库管理和维护的“Sybase SQL Server”,是一个可编程的数据库管理系统,是Sybase产品软件的核心,发挥数据管理,高速缓冲管理,交易管理的作用;二,支持建立数据库应用系统并开发“Sybase SQL Toolset,ISQL与SQL Server交互是一种SQL语法分析器,DWB是方便实用的数据库管理工具,APT主要从事实际应用的开发环境;三是其他制造商在异构环境下应用软件与任何类型的数据连接“Sybase Open Client / Open Server”。

总结

本文首先分析了论文管理系统的研究现状和发展趋势,并在论文管理系统的基础上阐述了开发环境和模型。从需求分析到功能设计,最终分析整个系统的设计过程。该系统克服了目前市场上纸张管理系

剩余内容已隐藏,支付完成后下载完整资料


资料编号:[453787],资料为PDF文档或Word文档,PDF文档可免费转换为Word

原文和译文剩余内容已隐藏,您需要先支付 30元 才能查看原文和译文全部内容!立即支付

以上是毕业论文外文翻译,课题毕业论文、任务书、文献综述、开题报告、程序设计、图纸设计等资料可联系客服协助查找。