Swing for Web?
java Open Source AJAX-based Web frameworks. Evaluation ResultsWe specified the requirementsfor the Open Source Java Web frameworks used in presentation layer of EnterpriseWeb Applications:1. Performance.
2. Modal dialogs.
3. Partial page refresh.
4. Component-based and event-driven.
The philosophy should be: a Web application should behave like a desktopapplication, and it should be developed like a desktop application.
Is it possible to satisfy all those requirements? How much will we have topay for the convenience and flexibility - with performance loss (whichtranslates into higher hardware cost)?
For example, explicitrepresentation of the complex UI state on the server should affect performanceand scalability. Partial page refresh means busy traffic between the clientand server, which also should affect performance.
To answer those questions, we performed evaluation and performance tests ofthe existing Web frameworks.
To meet our performance and usability requirements, a Web framework has to beAJAX-based, e.g. all components have to use AJAX for partial pagerefresh. Most Web frameworks are AJAX-enabled, e.g. only part of theframework components use AJAX for partial page refresh.
We evaluated the following component-based frameworks: SwingWeb, WebOnSwing,Wicket, wingS, Echo2, Oracle ADF Faces, ZK. For evaluation reports, see ourprevious posts.
SwingWeb, WebOnSwing, Wicket, wingS are not AJAX-based.
Oracle ADF Faces: for 30 simultaneous active users, Tomcat reported an error(consequence of the thread contentions).
ZK: the zkdemo-all.war application can not handle 40 simultaneous activeusers (CPU overload, max response time is too big). Multiple thread contentionsreported.
Echo2 is AJAX-based, supports modal dialogs, is component-based andevent-driven. Echo2 also has a verygood performance.So, Echo2 is so far the only framework which passed ourrequirements.
Does this mean that Echo2 will eventually become de-facto industry standardfor Web frameworks (replacing Struts)?
Wedon't think so.
There are several problems with Echo2. Theyare all related to one issue:Echo2 has a Swing-like API. Or let's refrase it: it does not have Swing API,although it could.This brings us to a very important evaluation criteria: toolssupport. NextApp, Inc. (a company behind the Echo2) sells EchoStudio2, which isa plugin for Eclipse. EchoStudio2 is not a WYSIWYG tool. Since Echo2 API is notstandard, and the framework is not widespread, tool vendors are not developingvisual editors forit. Also, using Echo2 API means for a developer one more APIhe has to learn.
IfEcho2 would use Swing API (like SwingWeb, WebOnSwing do), it would bringthe following advantages:
-developers could use many existing commercial or free java IDEs to visuallydevelop dialogs (every java IDE has Swing editor);
- it would be possible to have a single code base for desktop and Webapplications. This is a dream for many ISVs who have both desktop and Webapplications with the same forms. It would make possible tricks likedroppingSwing application JAR file into Web container andrenderingit as a Webapplication (likeSwingWeb does).
- familiar API: if you know Swing, you can develop Web applications. For javadeveloper, that would also help to answer positively on another evaluationquestion: "If you know this framework, will it help you to find a job?".
Weunderstand that NextApp makes money selling EchoStudio2, and if theychanged Echo2 to use Swing API, nobody would buy EchoStudio2. So, it is not intheir business interests.
If Echo2 is not an ideal Web framework, then is it possible to createone?
Yes!
SwingWeb andWebOnSwing proved that it is possible to render Swingapplication as a Web application, but have a poor performance. Echo2 proved thatSwing-like Web application with explicit representation of the complex UI stateon the servercan have a very good performance.
The task is to merge those frameworks. After all, they are all open sourceframeworks. No need to write anything from scratch. I would estimate that itwould take three man-year (pessimistic) to do this.
Who could do this?
1. A bigISV/ERP vendorwith existing vertical applications (Oracle, SAP?).
2. A big java tool vendor (Oracle, IBM?).
3. A big AJAX-tool vendor (Yahoo, Google?).
The upshot for such a vendor would be to have a growingecosystemaroundtheir products/services,fulfillingthewholeproduct requirement: thousands of developers would usetheir framework andcomponentsto customizetheir applications, to develop third-party applicationsand extensions,to accesstheir services.
The winning framework might become a part of the open source softwarestack (JBoss?).
The easiest way for them to do this would be to have the NextApp developersmodify Echo2: buy NextApp or license Echo2 (remember Oracle licensing JBuilderand developing JDeveloper?).
If someone prefers defining UI using XML, they should use JAXX+ Echo3 (Echo3 = Echo2 with SwingAPI). UsingJAXX for UI definition is similar to using Windows resource files for dialogtemplates, menus, images, strings etc.
Well, if you need to choose a Web framework now, what should you do?
Our suggestion: use Echo2; make sure your business logic is well separatedfrom the UI code, so that when a new winner with Swing APIemerges, you canmigrate without a big pain.Isolating the rest of your code from UI should befairly easy:since Echo2 is event-driven, most of the interaction happens inevent handlers.
There are alsomore questions to be answered regarding Echo2:
1. Is it possible to optionallysupport non-sticky clustering?
2. ServerPushis required for workflow applications. How will it affect theperformance of the application? Do we need to develop a custom Echo2 component(see Howserver push should NOT be used)?
3. How Echo2+Spring+Hibernate combinationwill perform? We need to testperformance of the HSE framework.
Related links:
Java Web Frameworks byMatt Raible
Crossingthe Chasm: Marketing and Selling High-Tech Products to Mainstream Customers(Paperback)by GeoffreyA. Moore
Permalink
页:
[1]