Tuesday, March 27, 2007

Java IDEs

Wednesday, August 16, 2006

Migrating EJB2.x applications to EJB3.0

Read my latest article on migrating applications written to the EJB 2.x or earlier specification to the EJB 3.0 specification.

Available at -
http://www.javaworld.com/javaworld/jw-08-2006/jw-0814-ejb.html

Monday, May 01, 2006

JDBC4.0 - Better Design and Ease of Development

Read my article on JavaWorld -
http://www.javaworld.com/javaworld/jw-05-2006/jw-0501-jdbc.html

This article discusses some of the design and performance improvements in JDBC 4.0 (JSR 221)

Saturday, February 18, 2006

Java NIO

Thursday, February 16, 2006

Java DAO Frameworks - ibatis, spring & jing

Buy and Build - The emerging pattern!

In the past we have had buy vs build

Wednesday, February 15, 2006

Client Oriented Service Assembly (COSA) - Beyond the rich client

Java Web User Interface Options

This is an attempt to illustrate, discuss and compare the different options available within the Java (more specifically J2EE) stack to build web user interfaces. In this essay/article the attempt is first to understand the requirements on the basis of usability and functionality. After that the common UI related design patterns are discussed. Then a survey of the different available specifications and frameworks attempts to show how they could be used to design and construct the different types of user interfaces.Finally one is involved in some level of cyrstal ball gazing into the future of Java UI level paradigms.

It might be important to define the scope of this article before we start illustrating the ideas. This article includes all posibilities related to a UI accessed through a web browser. It does not discuss other forms of UI access, namely desktop UI or device based UI. Further, this includes all possibilities within the usage of Java as the programming language and does not talk about cases where Java back-end code may be accessed through scripting language front-ends. It definitely does not discuss the web UI possibilities with other languages, which offer multiple alternatives to Java.

Usability & Functionality
The concept of usability is explained well in an article titled -
"Usability 101: Introduction to Usability" - as the ease of use of a user interface and the utility (does it do what users need it to do?) that it provides. Thus if we were to summarize some of the desirable characterstics of a web user interface, it may be the following:


  1. Interface for data input and output
  2. Layout of data in meaningful widgets and data holders
  3. Management of widget and data holders
  4. Management of different content types and multiple languages
  5. Navigation among interface components
  6. Action based on data and events
  7. Assembly of interface components, possibly from multiple sources
  8. Facilitation of multiple tasks concurrently
  9. Management of user session and state
  10. Integration with logic and data components in the other layers
  11. Continuous synchronization of the interface views with the data and model they represent
  12. Support for protocols used in internet based communications
  13. Integration with other applications at the client-side and the server-side
  14. Possibility of interactions with all the sensory elements of sight, hearing, touch, smell and taste ( Interaction with the sense of touch, smell and taste are almost impossible to achieve in a browser based scenario)
  15. Ergonomic and intuitive appeal for better Human Computer Interaction (Often difficult to define in a universal manner)

Web UI Design Patterns

Design patterns have become very popular after the Gang of Four Book. In the last few years both creation of new patterns and adoption of design patterns has gained momentum. In this section we will discuss some of the design patterns relevant to the user interface and the presentation tier.

A good place to start might be The Interaction Design Patterns Page. There is a sea of information concerning the interface design patterns and links to other resources on this page.

Some of the J2EE presentation tier design patterns have been discussed as a part of an OnJava article on the topic. (url : http://www.onjava.com/pub/a/onjava/2002/01/16/patterns.html) The patterns discussed are as follows:

  • Intercepting Filter: facilitates preprocessing and post-processing of a request.
  • Front Controller: provides a centralized controller for managing the handling of requests.
  • View Helper: encapsulates logic that is not related to presentation formatting into Helper components.
  • Composite View: creates an aggregate View from atomic subcomponents.
  • Service To Worker: combines a Dispatcher component with the Front Controller and View Helper patterns.
  • Dispatch View: combines a Dispatcher component with the Front Controller and View Helper patterns, deferring many activities to View processing.

Microsoft has also collated a set of presentation tier design patterns in the context of its .Net framework. These patterns apply to the Java web UI as well. The patterns enlisted as a part of the web presentation patterns are as follows :

  • Observer
  • Page Controller
  • Front Controller
  • Model-View-Controller (MVC)
  • Application Controller
The new paradigm of asynchronous updates to the HTML DOM and client centric rich functionality, commonly labeled as AJAX and RIA, is affecting the web user interface concepts. Michael Mahemoff is collating together some of the good AJAX web user interface design patterns at www.ajaxpatterns.org. ( This is a good collection of thoughts on AJAX but it worries me when people start putting together best practices about concepts and frameworks which are not even stable to have its standards defined and understood comprehensively)

Web UI specifications in Java

Java has multiple options to build web based user interfaces. Each of these specifications have evolved over the years and continue to do so as we speak. The focus on the web based UIs has moved from client-side to server-side and back and this has influenced the evolution of the specifications as well. The browser itself is capable of doing a lot of more things as compared to its initial version in the mid 90s. A notable feature of late is the implementation of the XMLHttpRequest object that facilitates AJAX based frameworks. Parallely we have learn't to include different content types in non-intrusive, reusable and configuration driven ways.

Though there is often a comparison on the superiority of one specification against the other, I personally believe that each of them have their place. Guess, without further delay, its time to start illustrating each of these specification.

  • Java Applets

Java Applets were the first web based Java user interfaces defined way back in 1995. Java Applets can easily be embedded into HTML. The JVM in the Java enabled web browser runs and manages the Applet life cycle. Applets mimic the functionality of a thick client over the web and thus provide a rich user interface. They were very popular initially but were criticized a lot for being slow, restricted in access only to servers where they originate from and issues related to the browser based JVMs. While many of these problems were real at that time, because of the restrictied bandwidth and the evolving technology, we have now come a full circle in embracing rich clients again. In fact the Flash based rich applications of today are the exact counterparts of the Java Applets, in that they run within a controlled VM in the browser and rely on the client side capabilities. It is unfortunate that Java Applets never lost their popularity.

Information on Java Applets can be found at http://java.sun.com/applets/ and at http://en.wikipedia.org/wiki/Java_applet

  • Java Servlets, JSP & JSTL

As the web became popular in the low bandwith era and ecommerce applications began to grow one saw the advent of the Common Gateway Interface or the CGI. CGI was a great begining but it had its scalability issues and Java Servlets came in at the right time to offer a good way to put plain text and dynamic functionality into a web application. Java Servlets had its own problem though, because one had to put in all the html elements as prints within the Java code. JSP came as an answer to separate the dynamic content and the static html elements and allowed Java developers and HTML designers to work side by side. A little later, the MVC ( Model-View-Controller) design pattern gained traction in building web applications.

  • Java Server Faces (JSF) - JSR 127
  • Java Portlet - JSR 168

Some Popular Frameworks to build Java Web Applications

  • Apache Struts
  • Spring Web Flow
  • Tapestry
  • Wicket
  • Cocoon
  • MyFaces
  • DWR
  • Echo

Choosing the right specification and framework to build the Java Web UI

Future of the Java Web UI