Evaluating Presentation Layer Development Frameworks for EJB Applications in J2EE Architecture



Similar documents
An introduction to creating JSF applications in Rational Application Developer Version 8.0

A Comparison of Open Source Application Development Frameworks for the Enterprise

<Insert Picture Here> Betting Big on JavaServer Faces: Components, Tools, and Tricks

CrownPeak Java Web Hosting. Version 0.20

OUR COURSES 19 November All prices are per person in Swedish Krona. Solid Beans AB Kungsgatan Göteborg Sweden

White Paper: 1) Architecture Objectives: The primary objective of this architecture is to meet the. 2) Architecture Explanation

MVC pattern in java web programming

Rapid Application Development. and Application Generation Tools. Walter Knesel

How To Write A Web Framework In Java

Portals, Portlets & Liferay Platform

Framework Adoption for Java Enterprise Application Development

SSC - Web development Model-View-Controller for Java web application development

Complete Java Web Development

Tutorial: Building a Web Application with Struts

Oracle Application Development Framework Overview

IBM Rational Web Developer for WebSphere Software Version 6.0

Oracle WebLogic Foundation of Oracle Fusion Middleware. Lawrence Manickam Toyork Systems Inc

JAVA/J2EE DEVELOPER RESUME

Web Frameworks. web development done right. Course of Web Technologies A.A. 2010/2011 Valerio Maggio, PhD Student Prof.

<Insert Picture Here> Building a Complex Web Application Using ADF and Siebel

The Oracle Fusion Development Platform

Core J2EE Patterns, Frameworks and Micro Architectures

What Is the Java TM 2 Platform, Enterprise Edition?

Preface. Motivation for this Book

Course Name: Course in JSP Course Code: P5

Design Approaches of Web Application with Efficient Performance in JAVA

Web Applications and Struts 2

Beginning POJOs. From Novice to Professional. Brian Sam-Bodden

Glassfish, JAVA EE, Servlets, JSP, EJB

How To Write An Ria Application

Architecture Guide Jahia EE v6.1

A Comparative Study of Web Development Technologies Using Open Source and Proprietary Software

2012 LABVANTAGE Solutions, Inc. All Rights Reserved.

<Insert Picture Here> Oracle Mobile Enterprise Application Platform Overview

What s New in IBM Web Experience Factory IBM Corporation

Oracle Identity Analytics Architecture. An Oracle White Paper July 2010

Case Studies of Running the Platform. NetBeans UML Servlet JSP GlassFish EJB

JBoss SOAP Web Services User Guide. Version: M5

This presentation is for informational purposes only and may not be incorporated into a contract or agreement.

Comparison of Software Development Productivity by EJB Versions with Enterprise of Standardization

Introduction to Apache Roller. Matt Raible Apache Roller Committer June 2007

HPC PORTAL DEVELOPMENT PLATFORM

Course Number: IAC-SOFT-WDAD Web Design and Application Development

Model-View-Controller. and. Struts 2

Converting Java EE Applications into OSGi Applications

applications. JBoss Enterprise Application Platform

How To Develop A Mobile Application On An Android Device

Research Article. ISSN (Print) *Corresponding author Lili Wang

Pentesting Web Frameworks (preview of next year's SEC642 update)

HPC Portal Development Platform with E-Business and HPC Portlets

PHP Web Authoring for Database Management based on MVC Pattern

Commercial software development with the help of J2EE architecture and MVC

BEAWebLogic. Portal. Portlet Development Guide

Oracle JDeveloper 10g for Forms & PL/SQL

UBS Training Course Catalog

High Level Design Distributed Network Traffic Controller

Building Web Applications, Servlets, JSP and JDBC

Building native mobile apps for Digital Factory

An Easy, Secure and Reliable Online Shopping & Payment System

Adding Panoramas to Google Maps Using Ajax

A content management tool for the QES system Developing of a web-based content management tool for touch printers

OXAGILE RESUMES SUMMARY OF QUALIFICATIONS TECHNICAL SKILLS SENIOR JAVA SOFTWARE ENGINEER

EBA Procurement Procedure for the Supply of Website Services 2016: Annex 1 System Architecture Document SYSTEM ARCHITECTURE DOCUMENT

zen Platform technical white paper

WEB APPLICATION DEVELOPMENT. UNIT I J2EE Platform 9

Customer Bank Account Management System Technical Specification Document

Resume of Victor Kachan (Web developer, Java developer)

Actuate Business Intelligence and Reporting Tools (BIRT)

PROJECT-BASES RISK MANAGEMENT

Performance Comparison of Persistence Frameworks

An Architecture for Web-based DSS

Web Cloud Architecture

OpenShift is FanPaaStic For Java EE. By Shekhar Gulati Promo Code JUDCON.IN

Master Thesis. Arnold Kemoli. Design and Implementation of a Dynamic Component based Web Application Framework

SOA REFERENCE ARCHITECTURE: WEB TIER

ActiveVOS Server Architecture. March 2009

JEE Web Applications Jeff Zhuk

Web Application Development and Frameworks

IBM WebSphere Process Server V7.0 Deployment Exam.

Implementation of an Enterprise-level Groupware System Based on J2EE Platform and WebDAV Protocol

Building and Using Web Services With JDeveloper 11g

Modern Software Development Tools on OpenVMS

Clustering Versus Shared Nothing: A Case Study

Software Development Kit

Developing Web Applications using JavaServer Pages and Servlets

Cache Database: Introduction to a New Generation Database

Web Development with the Eclipse Platform

Enterprise Application Development In Java with AJAX and ORM

DataDirect XQuery Technical Overview

Putting the power of Web 2.0 into practice.

Java (J2SE & J2EE) and Web Development Training Catalog

FACULTY STUDENT MENTORSHIP PROGRAM. A Thesis. Presented to the. Faculty of. San Diego State University. In Partial Fulfillment

Web Container Components Servlet JSP Tag Libraries

What means extensibility?

Testing and Deploying IBM Rational HATS 8.5 Applications on Apache Geronimo Server 3.1

Transcription:

Evaluating Presentation Layer Development Frameworks for EJB Applications in J2EE Architecture Ohm Samkoses, Dipl. -Inform. Matthias Vianden, Prof. Dr. rer. nat. Horst Lichter Abstract For medium to large organizations, information systems play an important role for information storage and retrieval. They are used to support business processes such as decision-making. In information systems, huge amountof data needs to be manipulated and visualized. One way to handle this complexity is to use Enterprise JavaBeans (EJB) [1] in a J2EE architecture. Since EJB has not been designed to work in the Presentation Layer, suitable Presentation Layer Development frameworks are introduced to enhanced thepresentation layer of the information systems. The MeDIC (Metric Definition Integration Calculation) system and XAM (exam Assignment and Management) system [2] are typical representatives of such information system. Nowadays, many frameworks, such as Java Server Faces (JSF), Wicket, and Tapestry, exist to cover the Presentation Layer. They provide a variety of features and architecture enhancements. The goal of this research paper is to evaluate frameworks for the Presentation Layer of information systems, which shared the same architecture with the proposed architecture of the MeDIC and XAM system. Keywords J2EE Architecture; Enterprise JavaBeans; Presentation Layer Development Frameworks; Information System; I I. INTRODUCTION Nthe proposed architecture, the Data Layer and Business Logic Layer are managed by EJB. The Presentation Layer communicates to the Business Logic Layer via Application Facade. The Presentation Layer is currently implemented using JSP/Servlet technology. However, the current design still has several defects, for instance: code redundancy, huge amount of classes, and low reusability. In consequence, J2EE presentation development frameworks minimize those defects and improve the efficiency of the system, which shared the similarities with the proposed architecture. The goal of this research paper is to evaluate frameworks for the Presentation Layer based on the proposed architecture, including the current solution (JSP/Servlet). The steps to achieve the goal of this research paperincluderequirements Ohm Samkoses is a master degree candidate of Thai-German Graduate School of Engineering (TGGS),King Mongkut's University of Technology North Bangkok (KMUTNB), Bangkok, Thailand (phone: (+66)87-550-3738; e-mail: ohm.samkoses@gmail.com). Dipl. -Inform. Matthias Vianden,is a research assistant of the Research Group Software Construction (SWC), RWTH Aachen university, Germany (email: matthias.vianden@swc.rwth-aachen.de). Prof. Dr. rer. nat. Horst Lichteris a professor at RWTH Aachen university and head of the Research Group Software Construction (SWC)(e-mail: lichter@swc.rwth-aachen.de). gathering and analysis, multiple rounds of frameworks selection with different criteria, prototype implementations, and results evaluation. The chosen frameworks for prototype development should fulfill most of the requirement and the prototypes implementation should reflect the solution for each requirement clearly, and must be able to work with the existing system's environment: the back-end is managed by EJB 3.0, and IBM Websphere Application Server 7.0. II. TASKS / STEPS A. First frameworks selection First step was to narrow-down the scope of the focused framework based mainly on framework popularity. Other factors were general web framework criteria [3], such as, learning curve, testability, configuration complexity, amount of artifact produced, architecture and pattern, tools and IDE, and supports from community. This first selection aimed for 5-10 frameworks as an output. B. Frameworks analysis The outputs from the first framework selection were analyzed at this step. The selected frameworks were compared to each other under five general web framework criteria: configuration complexity, learning curve, testability, community and support, tools and IDE. C. Requirements gathering and analysis All attendances were developers, who experienced using the system based on the proposed architecture. Also requirements prioritization was used to identify the important factor of each requirement. D. Second frameworks selection In the previous step, 3-4 frameworks were aimed to be selected as an output. The main factor of the selection is the requirements, the general web framework criteria were also affected, but less because the requirements represent the characteristics of the solution itself. In contradiction, even a framework fulfills most of the requirements, it should not fail on the general web framework criteria, which represent the characteristic of high quality, efficient, productive web framework. E. Prototypes implementation The selected frameworks wereimplemented for a proof of concept. For each prototype, there were five aspects need to be 37

mentioned: working environment and tools, framework's basic concepts, complete architecture after the integration of framework, project structure and artifacts produced, and steps to migrate from the existing system. F. Results evaluation All implemented frameworks were analyzed against the requirements. The result from the comparison against general web framework criteria in step 2 also affects the evaluation at this point. These important steps were demonstrated and explained in detail in the following chapters of this report. III. BACKGROUND The architecture of the existing system is based on the J2EE architecture. Follow the J2EE approach, the system is divided into 3 layers: Presentation layer, Business Logic layer, and Data layer. The presentation layer composed with plain JSPs and Servlets. The request from the browser will be centralized to the Action Handler Servlet and delegates to the corresponding Action class. The Action class communicates with the Application Facade in the Business logic layer. The Business Layer and Data layer are managed by EJB framework. The Application Facade delegates the request sends by Actions in Presentation Layer to the corresponding Controller. The controllers are the interfaces to simplify the business logic in Management. The Entity persisted, and the results from the database render in JSP page in the presentation layer. following seven most widely-used frameworks are selected for further research and analysis: Spring MVC (SpringSource.org) Java Server Faces (J2EE and JSR Standard) Wicket (Apache Software Foundation) Seam (JBoss) Struts2 (Apache Software Foundation) Tapestry (Apache Software Foundation) Stripes (Stripes) The existing system, pure JSP and Servlet Even though, web frameworks give you many benefits,but there are several criteria that should not be neglected. For example, testability, learning curve, community and support, tools and IDE, architecture and patterns, configuration complexity, and amount of artifact produced. The following diagram shows the comparison result of the frameworks selected from the 1st framework selection, in the context of some part of the criteria explained in previous section. Fig. 2Result from the output of first frameworks selection Fig. 1Architecture diagram of the existing system On the client layer, the existing system uses the Command pattern to encapsulate the request parameters. All requests pass through the Action Handler then the Action Handler delegates the request to the corresponding Action class. Both Action Handler and Actions are all ordinary Servlets built for request delegation and communication to the business layer. One example of the problem caused by this pattern is huge amount of Actionclasses since, for each user operation, one action class needs to be created. In consequence, at least ten action classes must be created per Entity (create, retrieve, update, delete, and assign actions), this will increase dramatically, if there are more object types in the system. IV. FIRST FRAMEWORK SELECTION Based on the statistic from Google Trends [4] and Zero Turnaround's Java EE productivity report 2011 [5], these V. REQUIREMENT GATHERING AND ANALYSIS There were 5 attendances. All of theattendants are developers working in the MeDIC or the XAM project. All attendances were free to express their own opinions about the original prototype, expected characteristics of the new architecture, and prioritize all requirements. The purpose of this requirements meeting is to get technical feedbacks and suggestions from the users of the original prototype and use those information as criteria for the 2nd frameworks selection and comparison. The selected frameworks will be analyzed in detail, implemented as prototype of the existing system, and evaluated in the following chapters. These following contents are the requirements: 1st priority (1) According to the feedback from user, convention over configuration framework is preferred. One factor that affect the complexity is large files in the system especially, configuration files such as xml files. There are very few tools/ide, which support xml auto-completion and verification. Asynchronous JavascriptAnd XML (AJAX) is a web development method used on the client-side to create 38

interactive web application. With AJAX, web application can send and retrieve the data from web server asynchronously (in the background) without any sign of page refresh. For the existing system, any frameworks have AJAX support are advantageous, but the system must still working perfectly, even without AJAX Community and support also important. The chosen framework's community should be active and provides support. 2nd priority (2) The framework should be Component-based and support inheritance architecture. Reusability is always first factor to indicates the quality of the software system. For the backend and business logic, one way to obtains the reusability is through inheritance structure. Most of the web application view created by markup language, which does not support inheritance structure, or any mechanism that provides the user interface reusability. One way to accomplished the 2nd priority requirement is component-based architecture framework. In component-based aspect, each page considered as a component, and each page can be constructed with multiple components, which means, each component can be reused to construct pages, which shared some similarity as many time as needed without code duplication. Also, the framework should be able to manage the request delegation automatically. This request delegation is responsible for moving a particular request through the right class. In the original prototype, the ActionHandler Servlet is responsible for the manual request delegation. The framework, which support better flow control is needed. 3rd priority (3) The framework with good IDE support such as autocompletion, UI builder, multiple project support is needed. 4th priority (4) The framework should provide high testability. VI. SECOND FRAMEWORKS SELECTION Fig. 3 Result from the output of second framework selection For the artifact complexity (1), almost of the frameworks passed, except Spring MVC and Stripes. Spring MVC has a serious problem with very high configuration complexity (pure XML, configuration over convention), and Stripes has a small community and not actively developed. For the component-based, inheritance structure architecture, and the request delegation supported (2), four frameworks have component-based architecture, which are JSF, Seam, Wicket, and Tapestry. Also, delegation and navigation supported can be achieved by Business Process Management framework integration such as jbpm. However, only Spring MVC and Seam supports perfect integration with jbpm, and only JSF and Struts2 have navigation rule. The navigation rule controls the flow of page navigation. Seam might be the most direct solution of this requirement since, Seam provides both navigation rule and jbpm to control page flow and business process flow. Spring MVC and Stripes have serious problem with poor IDE support (3). Even Wicket has no official IDE support, but since Wicket composed of HTML templates and pure Java, any Java IDEs and HTML editor provides full support. Other frameworks passed this requirement especially, JSF and Seam. After the requirements analysis, three frameworks were chosen to implement the prototypes. Those three frameworks are Wicket, JSF, and Struts2. Originally, Seam was chosen instead of JSF because, it fulfils all requirements. Seam is a full-stack framework which integrates several frameworks together. For presentation layer, Seam provides various choices including JSF and Wicket. There are several advantages of Seam using JSF over stand alone JSF including performance improvement.due to integration conflict between Seam environment and existing environment, the prototype implementation using Seam failed. Most of the frameworks are not qualified. Spring MVC fails most of the requirements especially, almost first 3 priority requirements. Tapestry was precluded because of theserious problem about no backward compatibility supported. Stripesfails 1st and 3rd priority requirements because the project is not actively developed and has no official IDE supported. Since all other frameworks are precluded, Struts2 is the best choice amongst the frameworks left. VII. PROTOTYPE IMPLEMENTATION A. JBoss Seam Seam provides alternative presentation layer development frameworks fully integrated with EJB covered backend.the EJB provided by Seam is the proposed architecture from the beginning, and two out of three presentation layer integration provided by Seam are the chosen frameworks (JSF, Wicket). The benefits of Seam integration other than the enhancements mentioned in chapter two is the ease of prototype development. Seam tied Wicket and JSF seamlessly to the backend and does not required any Action beans. Also, it is simple to develop the next prototype after the first one by changing only view technology without changing anything at the backend. Unfortunately, Seam prototype implementation failed. The cause of the failure is suspected to be the incompatibility of Seam and IBM Websphere 7.0 Application Server (WAS). Even the JBoss community's resource already stated the Seam installation on IBM Websphere 7.0 Application Server [6], but in practical use, it is not working in the existing environment. In consequence, the prototype implementation plan changed back to the original plan, which is developedbythe remaining prototype independently without Seam. 39

B. Java Server Faces (JSF) JSF has a very complex architecture, which consists of several design patterns working behind the scene [7]. Developers only need to know five components: FacesServlet, UI Components, JSP, Managed Beans, and Navigation Rules. The FacesServlet is the front controller of the system. All the requests from the client have been translated into mapped action and delegated to the corresponding page and the response from the system is sent back to the requested client. Every JSF pages contain JSF components both basic components (JSTL tags, Facelets), which represent only standard HTML, or third party libraries (PrimeFaces, ADF Faces, Trinidad, IceFaces, RichFaces), which provide advance widgets like trees, grids, tabs, or personal custom components. Each component's value might bound to the value in Managed Bean, and some components have event listeners, which call the methods in the Managed Bean, when triggered. Those methods in the Managed Bean handle the communication with the backend. The Navigation rules manage all page flowsof the system. Fig.4 New proposed architecture with JSF integration C. Apache Wicket Wicket's architecture is very simple. It is mainly composed of HTML templates bind tightly to POJOs with the same name. These paired HTML templates and POJOs represent web pages. Minimum number of artifact to build a page is two: one HTML page, and a POJO. In consequence, huge amount of artifacts are produced. However, Wicket's component-based architecture greatly reduces the complexity of artifacts. The developer may use basic Wicket components or even, create custom components using the same method as building a page. As a result, more than half of the artifact especially, HTML files have few simple lines of components' interface declaration, and POJOs are well-structured, highly reusable, and easyto understand with inheritance structure. The flow is quite simple. The Request Cycle acts like a front controller, delegates the request to the corresponding page, thenthe user interface components in HTML template will be initialized by POJO bound to that HTML. D. Apache Struts2 The goal of Struts is to separate the model from view and controller. Struts2 introduced Action bean as the controller to facilitatethe writing of templates for the view or presentation layer (typically in JSP, but XML/XSLT, Tiles, FreeMarker and Velocity are also supported). The web application programmer is responsible for writing the model code, and for creating a central configuration file struts-config.xml that binds together withmodel, view and controller. Fig.5 New proposed architecture with Wicket integration Interceptor is the core concept of Struts2, which provides great code redundancy reduction. Many Action beans sharecommon concern. Several Action beans need similar input validation. Some needs a file upload to be pre-processed. Another Action beans might need double form submission protection. Interceptors can execute code before and after the Action bean is invoked. Features like double-submit guards, type conversion, object population, validation, file upload, page preparation, and more, are all implemented with the help of Interceptors. Each and every Interceptor is pluggable, so developers can decide exactly which features an Action bean needs to support. Also, if a lot of Action beans areplugged with the same pattern of interceptors, Interceptor stack can be defined in the struts.xml to provide even more convenient. For example, every Action beans which related to very important task need to apply double-submit guards, user session validation, and encryption interceptor. Instead of spending three lines to apply all requiredinterceptoron every Action beans, registering an interceptor stack contained three required interceptors, and spentonly a line for applying the stack to the Action beans is more productive. Fig.6 New proposed architecture with Struts2 integration VIII. RESULTS AND EVALUATION From the current result, the most suitable framework to replace the proposed architecture is Apache Wicket. Struts2 is eliminated from the list because, it does not completely fulfill the first priority requirement (configuration complexity, community and supports) and does not fail the main second 40

requirement (component-based, inheritance structure supported framework). Even Struts2 is widely used and Interceptors provides great reusability, but compared to Wicket and JSF, Struts2 does not answer our question. The efficiency of Wicket and JSF are proximate. Both of them fulfill most of the requirements. Wicket completely fulfill first and fourth priority requirements with zero configuration, very vibrant community, and powerful unit testing API, while JSF also fulfill first requirement with some artifact complexity and few simple configurations. However, JSF has some problem on testing each layer separately. Facelets and navigation rule fulfilled the second priority requirement of JSF with template inheritance and user interface flow managementwhile Wicket was completely fulfillingthe component-based inheritance structure without any extra technology, but Wicket does not provide user interface flow management at all. The third requirement JSF and Wicket are proximal. JSF has very good tools and IDE supported, while Wicket does not need any additional tools or IDE. Since the result from comparingthe requirements alone cannot indicates which one is the most suitable framework to replace the proposed architecture, other important factorwhich needs to be considered. The reason why Wicket was chosen is JSF has a very serious issue on very high memory consumption rate, while one of the Wicket's prominent points is its light-weightiness. Many source did the comparison between JSF and Wicket memory usage, and some source even provesthat even JSF enhanced with Seam's JSF memory consumption optimization consumes more memory than stand alone Wicket [8]. Combining with very low learning curve and simple architecture with complete separation of presentation layer and business logic layer, Wicket is the best choice amongst all frameworksto replace the proposed architecture. existing system, Customer and Contract Management System. The result is Seam prototype implementation whichwas a failure and the rest were successes. Finally, all results indicate that Wicket is the most suitable framework to replace the proposed architecture. REFERENCES [1] Debu Panda, Reza Rahman, Derek Lane, "EJB3 in Action", Second Edition, Manning, 2007 [2] Dipl. Inform. Matthias Vianden (contact), Bachelor thesis SystematischeVerwaltung von Klausuren und Übungen, unpublished [3] Matt Raible, Comparing Web Frameworks, 2007, Raible Design, http://static.raibledesigns.com/repository/presentations/comparingjava WebFrameworks-ApacheConEU2007.pdf [4] Web page of Raible Designs, based on Google Trends statistic, August 2, 2011, http://raibledesigns.com/rd/entry/re_which_is_the_hottest, August [5] Java EE Productivity Report 2011, Zero Turnaround, July, 2010, http://zeroturnaround.com/java-ee-productivity-report-2011/ [6] Gavin King & Pete Muir & Norman Richards & Shane Bryzak&Michael Yuan & Mike Youngstrom& Christian Bauer & Jay Balunas & Dan Allen & Max Rydahl Andersen & Emmanuel Bernard &Nicklas Karlsson& Daniel Roth & Matt Drees& Jacob Orshalick& Denis Forveille&Marek Novotny &JozefHartinger, "Seam - Contextual Components. A Framework for Enterprise Java 2.2.1.Final", Seam Official Website [7] Daniel Perovich& Leonardo Rodriguez & Andres Vignaga, "Architecture of Component-based Information Systems over the J2EE Platform", August, 2005 [8] Peter Thomas, "Seam / JSF vs. Wicket: performance comparison", September 27, 2011, Increment Operations,Avialble at: http://ptrthomas.wordpress.com/2009/01/14/seam-jsf-vs-wicketperformance-comparison IX. SUMMARY This research paper indicates that Wicket is the most suitable J2EE-based presentation layer development framework for replacing the presentation layer of the proposed architecture. On the first step, seven frameworks were chosen based on popularity and general web framework criteria in order toroughly filtered out the low quality web frameworks from this research paper scope. Those frameworks are Spring MVC, Java Server Faces (JSF), JBoss Seam, Apache Wicket, Apache Struts2, Apache Tapestry, and Stripes. The main criteria of this research paper is the requirements gathered from the developers who had experience in using any system based on the existing architecture (proposed architecture). The requirements were gathered, prioritized, and analyzed into four main prioritized requirements and became the main criteria for the second round selection. Against requirements and general web framework criteria, seven frameworks were analyzed and compared. The result was four frameworks were chosen for the prototypes implementation. Those frameworks are Seam, JSF, Wicket, and Struts2. The purpose of the prototypes implementation is to prove the concepts and frameworks comparison in the same environment. All prototypes' structures were based on the structure of the 41