好文档 - 专业文书写作范文服务资料分享网站

MVC Design Pattern for the multi framework distributed applications using XML

天下 分享 时间: 加入收藏 我要投稿 点赞

MVC Design Pattern for the multi framework distributed applications using XML, spring and struts framework Abstract?a 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 I. I NTRODUCTION

Web is the very complex issues these days. Since the desire ofthe 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.

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

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. II. A PPLYING A RCHITECTURE WITH M ULTIPLE 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 it?ˉ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.

First is The View Block which controls the presentation part of the complete model. This contains 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 configuration 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 the 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 Logic: 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. 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 the 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: Spring?ˉs Front Controller implementation. It is the first controller which interacts to the requests. We can also say it is an implementation of the Servlet. It controls the complete flow of the application.

Controller: User created component for handling requests encapsulates navigation logic delegates to the service objects for business logic.

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.

ModelAndView: ModelAndView is the core part of the spring framework. It implements 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.

ViewResolver: How the output is to be displayed 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 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

MVC Design Pattern for the multi framework distributed applications using XML

MVCDesignPatternforthemultiframeworkdistributedapplicationsusingXML,springandstrutsframeworkAbstract?aThemodelviewcontroller(MVC)isafundamentaldesignpatternfortheseparat
推荐度:
点击下载文档文档为doc格式
3jjuu8xvkc55t2h95x553fre38hic90119v
领取福利

微信扫码领取福利

微信扫码分享