PDA

View Full Version : Opinion: JSF vs EXT-JS (or similar library) for UI rendering



sl5337
3 Jan 2008, 5:37 AM
First, I realize that comparing Java Server Faces to EXT-JS is not an 'apples-to-apples' comparison. EXT-JS is strictly a front-end rendering tool and is not concerned with the server-side programming language or technology platform. I believe this is a good thing. Java Server Faces also renders the front end but links the rendered components to server-side objects.

I have been working with EXT-JS for only a few weeks but I've found the UI rendering capabilities quite impressive. I am also seeing increased momentum in the Java community behind the Java Server Faces technology. One only needs to look at IceFaces to see how far JSF has come.

I am looking for opinions from those in the Java community who have used JSF (recently) and can compare that approach to the use of Javascript component libraries such as EXT. I'm not looking for a "which is better" type of discussion because each may have its place depending on the particular situation. Based on my experience with EXT so far, it will require a lot of Javascript and a fairly sophisticated understanding of the Javascript programming language to create the complex UI's that we require. However, its possible that this complexity can be mitigated somewhat by creating a set of standard templates that developers can work from. The examples that are provided with EXT go along way towards providing this already.

We are a strictly J2EE shop moving away from Struts as our 'MVC' framework and are trying to determine a standard that we can live with for the next few years. Thanks in advance for your thoughts on this matter. :-?

buzz
3 Jan 2008, 7:52 AM
If you are open to using GWT you should have a look at Gwt-Ext. Its a wrapper around Ext and allows you to design your UIs using Java.

fangzhouxing
3 Jan 2008, 10:52 PM
I begin a new project based on JBoss Seam 2.0(server side) and Ext 2.0. I have droped JSF completely from server side and use plain Servlet to render the login and main page. Since I use OPOA(One Page One Application) pattern, I render all other pages with pure JavaScript.

sl5337
4 Jan 2008, 3:45 AM
That's the direction I want to head in, I'm still concerned about the amount of Javascript involved. Its not necessarily the volume of Javascript that will be written but the maintenance and ongoing support of that code base by the rest of the development team. Java IDE's have come a long way towards facilitating the development and debug process. I'm not sure if there is anything remotely similar in the Javascript development world but that could be my own ignorance. We are strictly an IE7 (on the Intranet) development shop so I'm not familiar with any of the other browsers. I have read on this site that Firefox with the Firebug add-on is a good development environment so perhaps I should look at that even though we are 'deploying' only to IE.

Here's where I'm torn: On the one hand, using a Javascript component library clearly (in my mind) provide more separation between server-side business logic and client-side view rendering. Java Server Faces seems to mix the two by rendering the view with server-side code. However, using JSF means that your Java development team will be coding mostly in Java, not a mixture of Java and Javascript.

Having been a Java developer for many years now I am well aware of best practices in terms of code organization, object modeling and design patterns. It would be helpful if somone who has built a fairly substantial Web application based on EXT could share their thoughts on how to best organize the Javascript code. :-?

fangzhouxing
5 Jan 2008, 8:10 AM
hi,sl5337,about JavaScript code organization mode, you can see my jboss seam-ext sample project here:

http://code.google.com/p/seamextsample/downloads/list

rename the download file to seamextsample.war, and put it in Tomcat webapp dir, then you can see it in browser.