automatic GUI creation

Automatic GUI Creation
Generating Java source code from formal descriptions

1 Introduction

1.1 Background

The Ericsson IP telephony system consists of several distinct components, each having its own control and configuration demands. As an important part of the system, the operation and maintenance (O&M) subsystem consequently must be able to handle this mixed set of network elements and configuration parameters.

The upcoming O&M system will have a strongly modularized architecture, delegating the actual management functionality to specialized plug-ins. Thus, in order to handle a new type of network element, a plug-in must be developed and installed into the O&M framework. Each plug-in, in turn, must be divided into several layers of functionality. These layers are typically responsible for graphical user interface (GUI), interface logic, data backup storage, etc.

1.2 Problem

The development of plug-ins is cumbersome, and major parts of the development are suitable for automation. By using information from the formal descriptions for each element, a functioning skeleton plug-in can be created automatically, reducing development time by an order of magnitude. Apart from speeding up the development process, automatic code generation also has other benefits—similar structure will be imposed on all plug-ins (having significant maintenance benefits), interfaces will use standardized components, and some types of bugs will be avoided to a large extent.

Automatically generating source code is not trivial, however. The GUI component(s) can be guessed from the formal descriptions, but the selections made this way must be easy to change. Also, some data representations in the formal descriptions are not well chosen with respect to their actual contents and the mapping between data representation and GUI component is neither constant nor one-to-one.

Clever methods must be used for approximating the component choice, allowing the component to be changed dynamically, and converting underlying data to the format suitable for the chosen component. Ideally the automated process should also allow iterations, as already generated plug-ins may have to be regenerated when specifications change. The goal must be that automatically generated code should be at least as easy to maintain and extend as source code written entirely by hand.

There are several limitations to the results that can be obtained by automatically generating plug-ins. User interface layout and program logic are two examples of parts that can hardly be created automatically. Neither are highly specialized plug-ins a target for automation. The generated code can only be a support for the plug-in programmer, as several parts of the plug-in cannot be created well by automatic means.

1.3 Purpose and method

The main goal with this thesis was to show how far the automatic generation of the plug-in GUI could be pushed, and to implement these parts in a prototype application. Additionally, other parts of the plug-in creation have also been explained briefly and/or implemented in the prototype.

This thesis will primarily focus on three parts—analysis of the formal element descriptions, selection of components and other data structures, and code generation. Emphasis has been put on theory and design decisions, not on implementation details. For further information on the actual implementation, please refer to the source code comments.

The prototype application has been implemented in Java, and contains a set of solutions to the main problems. The prototype generates general, syntactically correct, indented and commented Java source code with some changes being necessary to fully fit the plug-in framework.