in2j - Swing
Quintessence Systems Limited is the creator of in2j, the 100% automated technology for migrating Oracle Forms, Reports and PL/SQL applications into the Java™ language - ready for immediate deployment to a J2SE / Swing platform, suitable for maintenance and development using Oracle JDeveloper, and a vital stepping stone to ADF.

Why migrate to Swing?

A reasonable question: why has Quintessence chosen to deploy its migrated Java™ code to a J2SE Swing platform, rather than J2EE / JavaServer Faces? Surely "Enterprise Edition" Java must beat the socks off the mere "Standard Edition"?

Actually no - in many cases Swing comes out on top. First let's see what Oracle itself has to say about Swing (our highlights in bold):

"The Java Swing platform was released in 1998 for the development of lightweight Java Web GUIs and client desktop applications. [...] Swing itself is a lightweight component set that is built on top of the Abstract Window Toolkit (AWT) and the Java Foundation Classes (JFC). Having been with us for over seven years, the Swing package is a very mature Java library in J2SE that is widely adopted for building enterprise class business applications.

The reputation of Swing is one of a flexible and powerful development environment that puts a lot of control into the hands of the application developer. It is not exaggerated to say that if you can think it in Java, you can build it with Swing. The price for this flexibility in Swing is complexity and a learning curve to master. Java IDEs like Oracle JDeveloper, NetBeans, and IntelliJ provide visual and 4GL editing for Swing that helps developers to get started quickly and also to get quite far without having to learn Swing in depth."

From "Swing or JavaServer Faces: Which to Choose?", by Frank Nimphius and Duncan Mills, product managers for Oracle Developer Tools - www.oracle.com/technology/pub/articles/nimphius-mills-swing-jsf.html

As well as being supported by JDeveloper, Swing is also fully compatible with Oracle ADF:

"ADF Swing is a small Java layer that binds the Swing domain model to the Oracle ADF binding. The ADF Swing developer declaratively sets the component model to a named reference in the ADF binding. Data controls in ADF expose a consistent client development API to different business services for Swing developers to work with. Data controls implement standard methods for creating, removing and inserting data, as well as controls to navigate through data sets. The ADF binding exposes a smaller subset of data accessible from the data control to the Swing application panel or frame.

Swing developers don’t need to know about the business service the application is build upon because they no longer work against specific model APIs. Likewise they have no responsibility for resource lookup or similar tasks. This is all handled by the JSR-227 implementation, which provides an effective inversion of control mechanism.

Because the development of ADF Swing applications is mostly a declarative task with ADF, it shortens the application development cycle for beginners and Java experts alike. For example, UI first binding makes rapid prototyping easy for project teams. An unbound version of the UI can be created as a proof of concept, and then later retrospectively bound to a service." [ibid]

And very quick to respond:

"Swing user interfaces are highly responsive and can refresh specific areas on the screen without repainting the whole. A stock application, for example, may send information to a Swing application about changed values, which the can be displayed to the user without having to re-query." [ibid]

And the J2SE JavaServer Faces technology, based on transacting across the web using a browser client, is not without its problems, for example, if you want to update, edit or delete database records.

"Update, Insert and Delete: The Web model is based on the HTTP protocol, which is not designed for transactional and dynamic business applications. JavaServer Faces automatically handles a lot of the problems Web developers were facing in the past, but still, with handling multi row updates, there is an area that requires the developer to have his hands on." [ibid]

And as Nimphius and Mills point out, these are problems that do not extend to Swing:

"In contrast, In Swing multi row operations are no-brainers for application developers e.g. working with ADF Swing." [ibid]

The authors conclude that J2EE / JavaServer Faces is the best technology for secure applications that are accessed over the internet and by mobile devices. And they express confidence that the technical difficulties which exist (for example, if you want to update, insert or delete records) will be overcome. Meanwhile, they advise,

" ... use Swing today if your application requires immediate response to user inputs or events that change the user display. This also is true for complex User Interfaces that have multiple master-detail dependencies displayed on one screen. Applications that need to perform immediate item validation, which could be based on complex logic, also find better support in Swing than on the Web. Another key argument for Swing is the need of desktop integration that goes beyond file upload and download. Examples for such integrations are local printer access, access to external devices like phones or scanners and similar.

Applications that need to define their own keyboard mappings are also better served with Swing than Web technologies where the enclosing browser consumes some keyboard combinations. Other browser functionality, like the browser back button, that could get in the way of the business controlled application navigation is not a problem when building Swing applications. Some businesses require applications to work offline, disconnected form the network, which is what you can build Swing applications for. Finally, Swing applications are developed in one language only, while JavaServer Faces uses a mixture of technologies like Java, XML and ExpressionLanguage.

The J2EE / JavaServer Faces technology has its place. But if you are looking for a Java platform on which to deploy migrated Oracle Forms (or Reports) applications, J2SE / Swing has the edge, in that it reproduces the attributes that characterise Forms. Moreover Forms applications are usually deployed over secure internal networks and used by skilled office staff, rather than by operational staff in the field, or by customers shopping on the internet.

Accordingly, J2SE / Swing emerges as the Java environment of choice for the migration of complex Forms applications.

Copyright © Quintessence Systems Ltd. Quintessence Systems Ltd is incorporated in Cardiff (England and Wales). Company number 03581770. Registered Office 50 Aston Street, Oxford OX4 1EP. Java and all Java-based marks are trademarks or registered trademarks of Sun Microsystems, Inc. Oracle and PL/SQL are registered trademarks of Oracle Corporation. Other names may be trademarks of their respective owners. Webdesign with thanks to rare form new media.