YOUR FEEDBACK
E-Commerce 2.0
Brian wrote: I think we're heading in the right direction, but we've still...


2007 West
GOLD SPONSORS:
Active Endpoints
Your SOA Needs BPEL for Orchestration
BEA
Virtualized SOA: Adaptive Infrastructure for Demanding Applications
Nexaweb
Overcoming Bandwidth Challenges with Nexaweb
TIBCO
What is Service Virtualization?
SILVER SPONSORS:
WSO2
Using Web Services Technologies and FOSS Solutions
Click For 2007 East
Event Webcasts

2008 East
PLATINUM SPONSORS:
Appcelerator
Think Fast: Accelerate AJAX Development with Appcelerator
GOLD SPONSORS:
DreamFace Interactive
The Ultimate Framework for Creating Personalized Web 2.0 Mashups
ICEsoft
AJAX and Social Computing for the Enterprise
Kaazing
Enterprise Comet: Real–Time, Real–Time, or Real–Time Web 2.0?
Nexaweb
Now Playing: Desktop Apps in the Browser!
Sun
jMaki as an AJAX Mashup Framework
POWER PANELS:
The Business Value
of RIAs
What Lies Beyond AJAX?
KEYNOTES:
Douglas Crockford
Can We Fix the Web?
Anthony Franco
2008: The Year of the RIA
Click For 2007 Event Webcasts
SYS-CON.TV
TOP THREE LINKS YOU MUST CLICK ON


JSF: A Wish List
Great but not perfect

Digg This!

Page 2 of 3   « previous page   next page »

On the controller front, JSF offers a simple way to define page flows and state management. And the event-based programming of Web UIs helped the further adoption of JSF by developers familiar with the concept from their work with tools such as Visual Basic, PowerBuilder, and Oracle Forms. Developers who pick up JSF quickly realize that it does a great job of clearly separating the View and Controller layers — especially when developers use the XML-based JSPX format.

Another key advantage of JSF compared to other Java frameworks is the extensive tooling support offered by all the major players in the Java IDE space. Most of the IDEs offer visual page layout editors, property inspectors, and component palettes, in addition to page flow diagrams for the controller part.

The result of these benefits is a development experience that is much more productive than the old JSP way — even when you take into account the popular Struts/JSP combination. However, as good as it is right now, there's always room for improvement. So here's a wish list for the future of JSF.

Standardize AJAX Integration into JSF
One of the key benefits of JSF is its component-based approach to UI development. Instead of spending time writing markup languages, developers just pick components and arrange them on a page to construct user interfaces. This becomes an even bigger benefit when you bring AJAX into the picture. Component sets from Oracle, Backbase, ICEFaces, and others are already offering built-in AJAX functionality, which means that developers don't have to worry about JavaScript, DOM manipulation, XMLHttpRequest coding, or issues with their application being portable across browsers. By relying on the AJAX behavior that's built into the components, developers can speed up AJAX-based application development considerably.

However, one problem starts to rear its ugly head once you try to use AJAX-based components from different vendors in the same application. Integration between "regular" JSF components usually works out of the box with basic components, and you can mix and match component sets, but with AJAX-enabled JSF components, the situation is different.

Since the JSF specification doesn't include a definition of how AJAX should be incorporated into the JSF lifecycle, each vendor/framework has its own approach to handling AJAX events, usually involving extending the JSF lifecycle. The result is that developers end up with one set of components that collides with the architecture of another set because they have different lifecycles. This must be addressed in the next release of JSF.

While it's likely that the back-end JSF lifecycle aspect of AJAX integration can be standardized, standardizing the DOM manipulation or client side might prove to be a bit more challenging. Still I think that it's also an area worth the attention of the JSF community to prevent the accidental overwriting of client-side events by components from various sources.

Simplify JSF Component Construction
Most JSF component sets offer basic functionality that ranges from simple input components to more complex components such as shuttles and trees. But in many cases users want to define higher-level components that include subcomponents with specific functionality and behavior. For example, an address component would have several input components, a couple of select lists for state and country, and additional AJAX functionality that defines the dependency between country and state. The address component could then be packaged and used in multiple pages and applications.

I'd like to see JSF include an easy, standard way to define aggregated components so they could be reused, not just in a specific project, but by the members of the JSF community. One possible approach to simplifying aggregated component constructions is found in Oracle's ADF Faces Rich Client framework. You can define a component out of other components, define parameters that will be passed to the component, and define facets in the composite component's layout that let consumers of the component change its behavior at runtime. You can see an example in this demo, http://tinyurl.com/29smsu.

Add More States
JSF uses POJO-based managed beans to maintain values across pages in an application. These managed beans have scopes that can be defined as none, request, session, and application. The JSF engine automatically saves the information for the requested duration, making state management easy.

But developers need at least one additional scope in many applications - a task scope, which lies between the request and session scopes. Data in the task scope would last for the duration of a specific task, which might span several pages — but not throughout the full session. This is such a common requirement that implementations of such a scope have appeared in many of the JSF-based frameworks; for example, Shale's dialog scope, SEAM's conversation scope, and ADF Faces's process scope. Since this is such a common requirement, I fully expect to see this scope included in the next JSF iteration.

Developers might also benefit from a view scope, which would be active while a specific JSF page is being used. The need for this scope is likely to grow because AJAX components enable a new type of user interaction model — the single page model. In this model, users complete multi-step tasks by interacting with a single Web page instead of switching between different pages for each step. It's easy to see how this new interaction model would make the view scope an important addition to JSF, simplifying inter-component communication inside a page.

Introduce a New Component in the JSF Flow
JSF provides a controller layer that takes care of navigation rules between pages in an application and handles controller logic. Additional controller logic can be written in POJO classes that you define as "managed beans". This structure provides a very clear separation between view logic (located in the actual JSF pages) and the controller logic, which is in a separate physical file.

However, the JSF controller doesn't provide a very good way to represent or invoke logic as part of the flow between pages. Usually, developers invoke logic as part of the code behind a JSF component as part of a backing bean. For example, suppose that between the navigation from page A to page B you need to manipulate some data. Most developers will just write this code in the backing bean for the button that executes the navigation from A to B. This of course is not a great idea since it ties the logic to a specific button on a specific page. Although this can be resolved to some degree by refactoring the code into a separate managed bean, only few developers actually bother to do this.



Page 2 of 3   « previous page   next page »

About Shay Shmeltzer
A group manager for Oracle JDeveloper, Shay Shmeltzer has worked with Java specializing in Oracle JDeveloper and the Oracle ADF Framework, since 1999. Since 1993, he has applied his expertise at Oracle in the realm of development, consulting, sales, marketing and product management. Shay is a frequent speaker in events and workshops. His blog is at http://blogs.oracle.com/shay.

shay shmeltzer wrote: Ian - indeed JBoss's Seam and Oracle ADF are probably the two most advanced JSF based framework and I would encourage anyone who is about to embark on a JSF project to have a serious look into both.
read & respond »
Ian Darwin wrote: Most of the things you ask for are coming in the WebBeans JSR (299) and, are in fact available now from JBoss Seam.
read & respond »
LATEST JAVA STORIES & POSTS
3rd International Virtualization Conference & Expo: Themes & Topics
From Application Virtualization to Xen, a round-up of the virtualization themes & topics being discussed in NYC June 23-24, 2008 by the world-class speaker faculty at the 3rd International Virtualization Conference & Expo being held by SYS-CON Events in The Roosevelt Hotel, in mi
Case Study: Java and the Mac
This is the story of a Mac application developer (okay - it's about two of them) who set out on a quest to find an application development tool based on Java so his boss would let him develop on the Mac platform, which he loved. There was only one catch - he had to find a tool th
A Lightweight Approach to SOA and BPM in Java Using jBPM
SOA is mostly associated with technologies such as BPEL, SCA and Web Services. But does SOA really imply these technologies? In this session we will show how you can use the service oriented approach while staying inside the Java world. jBPM is a powerful lightweight framework th
JavaOne 2008: Uncommon Java Bugs
Any large Java source base can have insidious and subtle bugs. Every experienced Java programmer knows that finding and fixing these bugs can be difficult and costly. Fortunately, there are a large number of free open source Java tools available that can be used to find and fix d
The 4 Core Principles of Agile Programming
One of the things I really enjoy at the moment is the recognition and adoption of agile programming as a fully fledged powerful way to deliver quality software projects. As its figurehead is a group of very talented individuals who have created the agile manifesto (http://agilema
JavaOne 2008: Sun Adds Comprehensive Video Capabilities to JavaFX
Sun Microsystems announced it has entered into a multi-year agreement with On2 Technologies to add comprehensive video capabilities, using On2 Technologies TrueMotion video codecs, to Sun's JavaFX, a family of products for creating Rich Internet Applications (RIAs) with immersive
SUBSCRIBE TO THE WORLD'S MOST POWERFUL NEWSLETTERS
SUBSCRIBE TO OUR RSS FEEDS & GET YOUR SYS-CON NEWS LIVE!
Click to Add our RSS Feeds to the Service of Your Choice:
Google Reader or Homepage Add to My Yahoo! Subscribe with Bloglines Subscribe in NewsGator Online
myFeedster Add to My AOL Subscribe in Rojo Add 'Hugg' to Newsburst from CNET News.com Kinja Digest View Additional SYS-CON Feeds
Publish Your Article! Please send it to editorial(at)sys-con.com!

Advertise on this site! Contact advertising(at)sys-con.com! 201 802-3021

SYS-CON FEATURED WHITEPAPERS

ADS BY GOOGLE
BREAKING JAVA NEWS
eApps Hosting Now Offers the GlassFish Java Application Server in Economical VPS Hosting Plans
eApps Hosting announced that the GlassFish Open Source Application Server for Java EE 5, from