| By Mauro Carniel | Article Rating: |
|
| September 5, 2007 09:15 PM EDT | Reads: |
41,158 |
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.
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.
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).
Published September 5, 2007 Reads 41,158
Copyright © 2007 SYS-CON Media, Inc. — All Rights Reserved.
Syndicated stories and blog feeds, all rights reserved by the author.
More Stories By Mauro Carniel
Mauro Carniel is an architect at Tecnoinformatica Group. He has more than 9 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.
- Kindle 2 vs Nook
- Why IBM’s Server Chief Got Busted
- Is Cloud Computing Like Teenage Sex?
- Industry Experts Discuss the State of Cloud Computing
- Performance Tuning Essentials for Java
- Confessions of a Ulitzer Addict
- Tactical Cloud Computing Panel at 1st Annual GovIT Expo
- It's the Java vs. C++ Shootout Revisited!
- Cloud Computing Can Revitalize Your Career as Software Developer
- IBM Could "Reinvent" Java: Mills
- Oracle & Cloud Computing: Exclusive Q&A with SVP Richard Sarwal
- A Brief History of Cloud Computing
- Kindle 2 vs Nook
- Cloud CEOs, CTOs & SVPs to Speak at 4th International Cloud Computing Expo
- Why IBM’s Server Chief Got Busted
- Is Cloud Computing Like Teenage Sex?
- Industry Experts Discuss the State of Cloud Computing
- Performance Tuning Essentials for Java
- The Difference Between Web Hosting and Cloud Computing
- Cloud Computing Expo: Exclusive Q&A with Yahoo! SVP Cloud Computing
- Ajax in RichFaces 3.3, JSF 2 and RichFaces 4
- Confessions of a Ulitzer Addict
- My Thoughts on Ulitzer
- Tactical Cloud Computing Panel at 1st Annual GovIT Expo
- A Cup of AJAX? Nay, Just Regular Java Please
- Java Developer's Journal Exclusive: 2006 "JDJ Editors' Choice" Awards
- The i-Technology Right Stuff
- JavaServer Faces (JSF) vs Struts
- Rich Internet Applications with Adobe Flex 2 and Java
- Java vs C++ "Shootout" Revisited
- Bean-Managed Persistence Using a Proxy List
- Reporting Made Easy with JasperReports and Hibernate
- Creating a Pet Store Application with JavaServer Faces, Spring, and Hibernate
- What's New in Eclipse?
- Why Do 'Cool Kids' Choose Ruby or PHP to Build Websites Instead of Java?
- i-Technology Predictions for 2007: Where's It All Headed?





































