YOUR FEEDBACK
Cloud Computing: Do You Really Want Your Data in the Cloud?
Don Dodge wrote: D Cheng, Of course in-house systems go down. What I am sa...


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


Developing Rich Internet Applications Using Swing
A solution based on OpenSwing & Spring frameworks

Digg This!

Page 2 of 3   « previous page   next page »

The graphics controls are compliant with Java Beans specifications so they can be used in an IDE graphical designer environment like NetBeans, JBuilder, JDeveloper, or Eclipse (when combined with the Window Builder plugin) to create graphical windows by drawing them in the graphical designer as with other non-Java RAD environments.

The framework can create applications based on the SDI (Single Document Interface) or MDI (Multiple Document Interface) paradigm and internal frames including pull-down menus, tree menus, and many front-end customization levels (see Figure 4).
• Create a business logic + data-access tier through a set of utility classes that simplify the server-side development process; this utility layer can be omitted and replaced by other popular server-side frameworks, such as Spring and combined with ORM layers like Hibernate or iBatis; for these products OpenSwing provides some helper classes that makes them easy to embed.
• Create a data retrieval tier between the presentation tier (application front-end) and business logic tier. This tier can be easily extended by developing a communication layer above the standard layer offered by OpenSwing (HTTP-based) to meet specific needs (such as RMI communication with EJB, SOAP, or other communications mechanisms with server-side applications).

This framework also provides some basic features that cover many issues that usually arise in enterprise applications, such as data extraction from grids, document viewing on the most popular desktop applications (like reports on Excel, Acrobat Reader, etc.), activities logging, internationalization support (label translation, date format, decimal symbols, grouping, currency support, etc.), and authorization management according to grants owned by the connected user.

All these framework layers strongly decouple each other, so they can be used in a distinct way according to specific needs. Each layer in the framework depends on underlying layers of the framework.

The main software components of the framework are reported in the schema (see Figure 5).

Framework classes are in large part related to the graphics controls used in the presentation tier (orange color); other presentation tier classes include data retrieval, managing events fired by graphics controls, and client-side logging (green color).

The OpenSwing framework provides server-side classes too not directly connected to presentation tier classes that can be applied with three-tier applications (cian color) to simplify the realization of the Web layer and data access layer.

The OpenSwing data access layer maps value objects (POJO objects) to SQL instructions used to retrieve data from a relational database or to insert/update records. Through this layer the ORM activity (Object-to-Relational Mapping) is greatly simplified. It can be combined with the rest of the server-side layer in the case of three-tier client/server applications, or it can be combined directly with the presentation layer in two-tier client/server applications.

It's also possible to fully replace this layer with other (more efficient) ORM products such as Hibernate or iBatis.

Developing RIAs Using OpenSwing & Spring Frameworks
RIAs are three-tier applications with the same features and functionality as traditional desktop applications but typically run in a Web browser and don't require software installation.

The rise of RIAs lately has become an important topic in the Java community. Besides new technologies like AJAX and Macromedia Flex, the combination of Swing and Java Web Start has also been proposed as a RIA technology. However, HTML/AJAX or Flex technologies aren't without weakness like Swing.

A possible solution is the combination of OpenSwing and the Spring framework deployed with Java Web Start.

Spring is one of the most popular server-side frameworks for developing Java Web applications; it offers several advantages when developing a Web application, such as facilities to interconnect other technologies, like Hibernate, iBatis, JSF, and Struts.

The Spring framework has been designed to strongly decouple server-side layers that compose a Web application, like the data access layer, transaction management, and presentation layer based on Web pages.

Spring can easily be used in combination with applications having a non-HTML front-end too; in this case it's still possible to use some Spring features such as a data access layer and transaction management without using other layers such as the presentation layer based on Web pages (JSP, JSTL, Turbine, etc). Hence, Spring can be connected with GUIs based on OpenSwing.

The greater strengths of this combination are:

  • Rich GUIs
  • Good response time because communication between the client and server tiers is limited to data exchange
  • Development time of the rich GUI is lesser than HTML/AJAX thanks to IDE graphical designer adoption and the power of adopted client-side solutions so development costs are low too
  • Application installation isn't required because updating and distributing the client-side application is managed through Java Web Start that caches this layer the first time it's been downloaded
  • Users can use the client-side application from any computer with an Internet connection because client-side applications communicate through the HTTP protocol with server-side applications
  • Client-side applications are compatible with any operating system with a Java Virtual Machine; this isn't always true with HTML-based applications where JavaScript/HTML isn't compatible with all browsers and operating systems
  • Server-side application development is based on an excellent framework: it's possible to inherit all advantages that Spring provides, such as XML-based configuration, strong decoupling between server-side layers, inversion of control, dependency injection, transactions management, object relational mapping, Aspect-oriented programming, Spring Application Context, etc.
OpenSwing provides utility classes that can be used when combining it with the Spring framework and when combining it with an ORM product, such as Hibernate or iBatis to simplify the management of client-side info passed to the ORM layer and used to drive data retrieval (filtering or sorting conditions, pagination settings, etc.).

Utility classes provided by OpenSwing to embed the Spring framework consist of:

  • A HandlerMapping class to support HTTP requests originated from OpenSwing client-side classes; such HTTP requests contain serialized objects that must be managed on the server side (e.g., action class to invoke, filtering or sorting conditions, pagination settings, etc.)
  • An interceptor class to support client session identification
  • A ViewResolver class to support HTTP responses to send to OpenSwing client-side classes that expect POJOs as results.
With this helper classes it's possible to connect an OpenSwing client-side application having a Swing-based front-end to a server-side application based on Spring using HTTP as the communication protocol. Since only POJOs are transmitted between client and server layers, the response time is good, so this kind of application can be successfully applied in Internet-based environments such as RIAs.

Behind Spring there's usually a data access layer typically based on some ORM tool such as Hibernate or iBatis. When adopting Hibernate or iBatis there are some utility classes provided by OpenSwing that simplify the input process originated from the client side: for example, filtering or sorting conditions applied to a grid or pagination issues automatically managed through these utility classes to simplify their use inside the ORM layer (see Figure 6).



Page 2 of 3   « previous page   next page »

About Mauro Carniel
Mauro Carniel is an architect at Tecnoinformatica Group. He has more than 7 years of enterprise software development experience utilizing J2EE-based technologies, including JSP, JSF, Swing, EJB. He started focusing more on GUI-based client/server Java applications since 1998. He has a MSc in Information Technology from University of Udine, Italy.

LATEST JAVA STORIES & POSTS
Saving Your Investment: Transforming J2EE applications into Web 2.0 using GWT
The pressure is on to keep pace with Web 2.0 entrants into the marketplace. Rewriting is expensive; adding AJAX widgets results in a complex, unmaintainable application. Both require you to hire scarce JavaScript developers. Google Web Toolkit -- the SDK that allows you to write
WSRP Really Works! - Part 2
A standard from OASIS called Web Services for Remote Portlets (WSRP) is used so portlets can be decoupled from a portal. In part one (JDJ, Volume. 13, issue 3) of this article, we introduced the relevant standards and specifications and then demonstrated WSRP's capabilities by co
Adobe's Kevin Lynch and Microsoft's Scott Guthrie to Keynote AJAX World RIA Conference & Expo
Two of the biggest launches in Rich Internet Application history took place in 2007/2008 when Adobe launched AIR 1.0 in February '08 and Microsoft launched Silverlight (September '07). At the 6th International AJAXWorld RIA Conference & Expo in October SYS-CON Events is delighted
Sun Expects Q4 Earnings Above Estimates
On Tuesday evening Sun issued a fourth-quarter guidance range largely above analysts' estimates. The company pre-announced that revenue for its fiscal fourth quarter ended June was $3.725 billion to $3.8 billion, with gross margin in the 44-45% range. Sun expects non-GAAP profits
Virtualization Conference Keynote Webcast Live on SYS-CON.TV
Brian Stevens, the Chief Technology Officer and Vice President of Engineering of Red Hat, delivered his Virtualization Keynote 'The Future of the Virtual Enterprise' at SYS-CON's Virtualization Conference & Expo 2007 West in San Francisco. 'Virtualization is the hottest subject
The Beauty of JavaScript
JavaScript is one of the most interesting and misunderstood programming languages in common use today. Most developers will go their entire careers without realizing its full potential. It's not often that you get a language that supports the feature set that JavaScript does, whi
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

SPONSORED BY INFRAGISTICS
SOA in a JVM: OSGi Service Platform - A Dynamic Component System for Java
There are many forces that influence technological evolution. After a decade of building enterprise
AJAX and Enterprise RIA Tools - JSF, Flex, and JavaFX
2008 is going to be an important year for Rich Internet Applications. Most organizations are deliver
Final Voting Phase on OpenAjax Browser Wishlist
The OpenAjax Alliance is developing an Ajax industry wishlist for future browsers, using a dedicated
AJAX World RIA Conference News - Netflix UI Guru To Present on Crafting Rich Web Interfaces
In every field of design one of the first things students do is learn from the work of others. They
Infragistics Releases CTP UI Components for Microsoft Silverlight Beta 2
Infragistics announced the availability of two Community Technology Preview (CTP) User Interface (UI
Yahoo User Interface 2.5.2 Released
The YUI development team has released version 2.5.2; you can download the new release from SourceFor
ADS BY GOOGLE
BREAKING JAVA NEWS
Domark International, Inc. Completes Its Acquisition of Javaco, Inc.
Domark International, Inc. (OTCBB:DOMK) announced today that it has completed its acqui