Wednesday, August 16, 2006
Migrating EJB2.x applications to EJB3.0
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
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
Thursday, February 16, 2006
Wednesday, February 15, 2006
Java Web User Interface Options
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:
- Interface for data input and output
- Layout of data in meaningful widgets and data holders
- Management of widget and data holders
- Management of different content types and multiple languages
- Navigation among interface components
- Action based on data and events
- Assembly of interface components, possibly from multiple sources
- Facilitation of multiple tasks concurrently
- Management of user session and state
- Integration with logic and data components in the other layers
- Continuous synchronization of the interface views with the data and model they represent
- Support for protocols used in internet based communications
- Integration with other applications at the client-side and the server-side
- 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)
- 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:
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
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