Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ


Choose your language

InfoQ Homepage News Standard Application Framework for Swing Proposal Approved

Standard Application Framework for Swing Proposal Approved

Unlike the web development world, the Swing community has long been lacking standards or frameworks for how to best design applications.  This may change soon, as JSR 296, Swing Application Framework, has been approved by the JCP. 

The proposal defines the need:
Well written Swing applications tend to have the same core elements for startup and shutdown, and for managing resources, actions, and session state. New applications create all of these core elements from scratch. Java SE does not provide any support for structuring applications, and this often leaves new developers feeling a bit adrift, particularly when they're contemplating building an application whose scale goes well beyond the examples provided in the SE documentation.
JSR 296 will standardize:
  1. The essential application lifecyle, startup and shutdown, with well defined milestones so that applications can insert startup or shutdown work when the application has reached a well known state.
  2. Support for loading localized resources. Desktop applications deal with a set of common resource types beyond message strings, notably images, colors, and fonts. Resources can also be specific to the platform or to the application's "branding".
  3. Persistent session state. Most applications need a way to persist things like top level window geometry across sessions. Automatic support for such common cases as well as for loading and storing arbitrary session data at startup and shutdown time, would be useful in most Swing applications.
  4. Actions define the behavior of Swing application from the user's perspective. In all but the smallest applications, it's useful to be able to loosely couple an Action's (localized, branded, etc) presentation from its implementation. Action implementations often must perform some work asychronously wrt to the Swing event dispatching thread. The application framework would provide support for doing so and for providing GUI feedback while significant work is being done on the user's behalf.
The JCP EC all voted yes, with the following comment from IBM:
This JSR aims to address a common challenge for Swing developers - IBM acknowledges the underlying need which this JSR targets. Since Sun have proposed that this JSR will be considered for inclusion into Java SE 7.0, we suggest that the JSR-296 Expert Group take care to preserve the JSR's current scope as they progress. This is to ensure that JSR-296 doesn't grow into an unnecessarily large application framework which could further overload the Java SE platform in the future.

The expert group is still being formed and currently includes Ben Galbraith from Ajaxian.  The spec aims to have a final framework ready for Java 7 (Dolphin), with an early review draft later this year.

Rate this Article