Scaffold small client application frameworkwww.meldcraft.com
Scaffold - small client application framework for Java

Introduction

Scaffold is a small client application framework for Java that dissolves many barriers to client (particularly Swing) application development.

This is accomplished by replacing relatively complex Java coding with simple declarative programming. For example, instead of having to code the connections for MVC interaction inside participating objects or create a subclass of SwingWorker to perform Actions or other work in the background, Scaffold provides a simple way to declare these interactions in a properties file.

The typical result of using Scaffold is that a GUI (or other user interface) is succinctly defined mostly, if not entirely, in properties files, and Java code is mostly or entirely dedicated to business logic (usually POJO's).

Scaffold is highly non-invasive:

  • Scaffold is not a language. Scaffold properties files are not compiled or precompiled; they are read as-is at runtime to create and assemble Java Objects.
  • Scaffold does not require custom Swing or AWT Components.
  • Scaffold does not require Java Objects to implement special interfaces or extend special classes to integrate with the framework.

Scaffold was created to allow both beginning and advanced programmers to write professional quality Java standalone client applications more quickly and easily, and to scale well from the simplest "Hello World" application to a sophisticated enterprise application suite.

In stark contrast to traditional Swing programming, Scaffold actually makes it easier to write applications using robust, scalable implementation patterns, than to write them using "Hello World" style non-scalable "shortcuts". There are many examples for comparison.

Value Proposition

Quite simply, Scaffold allows developers to create client applications composed of robust and scalable implementation patterns written using minimal text to define elements and interactions.

The Trouble With Swing

So, what's wrong with Swing?

Nothing! Well, lots of people have a pet feature or bug they could live without, but, fundamentally, Swing is a really rich and capable means of creating common GUIs.

The problem with most Swing applications is - they are written in Swing! That is to say that, while Swing provides a great collection of GUI controls and adequate infrastructure for creating custom components, it is simply too low level of an API and lacking in key infrastructure for high level application development. The code required to implement many common concepts often exceeds the complexity of the concepts themselves.

Scaffold alleviates the problem by expressing many common concepts in a form that is maximally succinct without being obtuse, thereby improving productivity, clarity and quality.

The Scaffold Solution

The fundamental problem is code. A lot of time and effort in the Java community has been spent on frameworks of code, and enhancements to make code more resilient. But, really, code is simply a too verbose and arbitrary form of expression for a lot of common client application concepts.

Take actions, for example. Lets say I have a method foo() on a POJO that I want the user to invoke from a toolbar button, a menu item and button in a panel. Clearly, the Swing Action pattern is a good way to handle the situation. But, there certainly is a lot of code involved to make that happen.

Here is an entire Scaffold application that does this. The GUI is defined entirely in a normal Java properties file, and the POJO is appropriately implemented as a Java class:

mypkg/MyApp.properties
Application.mainmenu = Tools
Application.maintoolbar = DoFoo
Application.rootContent = DoFoo
Tools.items = DoFoo
DoFoo.method = foo
DoFoo.target = POJO
POJO.className = mypkg.MyFoo
mypkg/MyFoo.java
package mypkg;
public class MyFoo {
    public void foo() {
        //do something
    }
}

MyApp

Not gonna win any awards for looks, but, it couldn't possibly be any simpler to write, could it?

The great thing is that, under the hood, Scaffold did exactly what the developer would normally have to do for a scalable implementation:

  • Create a MyFoo object
  • Create an Action that calls foo() on the MyFoo object in the actionPerformed() method
  • Create a menu item using the Action
  • Create a toolbar button using the Action
  • Create a plain old button using the Action
  • And, of course create and compose the frame, menu bar, toolbar, etc.

Naturally, Scaffold allows the developer to override the classes used for the action, button, etc.

Review some of the example applications and you will see that it is just as simple to make the call to foo() in an asynchronous thread while displaying a busy cursor, and even show a progress bar. Scaffold provides a growing list of similar concise declaration of other common client application concepts including MVC interaction.

Why Use Scaffold?

Scaffold accelerates and simplifies client application development by taking the work (and the Java code) out of many common tasks:

  • Application instance management:
    • running multiple applications in a single VM, and passing data between them
    • ensuring only one instance of an application is running
    • opening multiple application instances in a single VM or multiple VM's
    • ensuring exactly one instance of an application for each unique datum that is opened
  • Application life-cycle management
    • prompting the user before closing an application instance
    • exiting the VM when the last application is closed
  • Implementing menus, popup menus, toolbars and buttons (i.e. Actions)
  • Binding multiple objects using MVC architecture
  • Coordinating asynchronous operations with the Event Dispatch Thread (i.e. SwingWorker type interactions)

The core Scaffold framework is suitable for non-GUI, e.g. command line interface (CLI), applications (i.e. it does not require GUI objects). Additional (optional) framework makes integrating Java Swing Components a breeze.

Scaffold encourages separation of business logic from GUI implementation details.

The Scaffold Swing GUI framework provides human readable, intuitive panel layout using simple text based notation.

Scaffold requires very little new API to learn, and even allows experienced developers to forget a bit of the typical tedium.

Scaffold facilitates simple application customization; e.g. configuring platform (OS) specific menu accelerators, and changing skins.

Scaffold allows you to spend more time working on what your application does, and less time hooking up basic functionality.

License

Scaffold is published as free software under the GNU Lesser General Public License (LGPL).

Get Started

Download Scaffold, and check out the Slacker Guide to Java Swing Application Development.

© 2007 Meldcraft Corporation