Thanks  Introduction  Design Patterns  Infrastructures  License  Home 

Introduction
The development of statistical software is an exciting area. Many statisticians around the world are using statistical packages to reach at conclusions everyday. Developing useful and modern statistical packages is thus crucial. Java, with many attractive features, is an ideal language for the implementation of a statistical computing environment. JavaStatSoft, implemented using Java, is a software with a GUI (Graphical User Interface). The aim of the software is to offer a freely accessible alternative to commercial statistical software.

Design Patterns
  • Why Design Patterns
    As developing a modern object-oriented software with numerous codes, a good design will be very important. Design patterns, popularized by GoF (the Gang of Four, see Gamma, Helm, Johnson, and Vlissides, Design Patterns: Elements of Reusable Objected-Oriented Software, 1995), is a common discussion topic in software development teams around the world. As indicated by GoF (p. 360, 1995): "A design pattern systematically names, motivates, and explains a general design that addresses a recurring design problem in object-oriented systems. It describes the problem, the solution, when to apply the solution, and its consequences. It also gives implementation hints and examples. The solution is a general arrangement of objects and classes that solve the problem. The solution is customized and implemented to solve the problem in a particular context". To make a modern statistical software successful, design patterns might play a key role. A good design pattern not only helps the software developers organize or polish the codes but also provides the other programmers a blueprint for examining codes, analyzing application development, and communicating software design. Several commonly used patterns have been used in JavaStatSoft. These patterns are introduced in the following.

  • Model-View-Controller Architecture (MVC)
    The Model-View-Controller architecture (MVC) is a well-known object-oriented user interface design decomposition originally used to build user interfaces in Smalltalk-80. Components are broken down into three parts, a model which specifies the characteristics of an object, a view which determines the visual presentation in the screen and a controller which defines how the component reacts to any input events from input devices such as the keyboard or mouse. For instance, the TableModel interface in JDK (Java Development Kit) specifies the methods the Java class JTable will use to interrogate a tabular data model, the TableCellRender interface describes the render used to display cell data and the TableModelListener defines the interface for an object that listens to changes in a TableModel. The programmers create concrete implementation of these interfaces such that the data model (Model), the "look" (View) and the "feel" (Controller) of a component can be customized. Many modern user interface frameworks coalesce the view and the controller in different programming languages, including Smalltalk, C++ or Java. Swing packages in Java combine component's view and controller into an object called a UI delegate (see pp. 11-14, Robinson and Vorobiev, Swing, 2003). The package statdialog is also based on the MVC structure. In practice, the contents of many statistical dialogs are constructed using a scheme similar to the following:
    1. groups (or panels) of controls are laid out in the vertical direction.
    2. labels or buttons and their corresponding input fields, lists, comboboxes and checkboxes form two-column structures.
    3. large components (such as tables, text areas and trees) are usually placed in scroll panes and they occupy all space in horizontal direction.
    Based on the above scheme, the package statdialog.layout consists of classes which create the layout provided by Robinson and Vorobiev (2003, pp. 131-136) as default. The users can also create the other layout for the two-column structures. Other packages, including stathelp and free, are also based on the MVC architecture.

  • Template Method
    Template Method defines the skeleton of an application (see GoF, pp. 325-330). The implementation of certain components is usually delegated to subclasses. In most statistical software with a GUI, the basic steps for creating a statistical module are (in sequential order)
    1. to create the data (or data frame) and select the required data for analysis,
    2. to create the dialog such that the users can set up the arguments for a statistical model,
    3. to carry out the required statistical analysis,
    4. to generate the report for the output.
    The statistical modules implementing the above processes in this software are based on the Template Method.

  • Factory Method
    Factory Method is another commonly used design pattern (see GoF, pp. 107-116). The main purpose of this method is to create a required object (product). The abstract class only defines the method(s) for creating an abstract object while the subclasses instantiate the required object. The Factory Method pattern can incorporate with the Template Method pattern. Certain components within the framework defined by the Template Method can be implemented by the Factory Method.

  • Data Analysis Module Framework
    Since a GUI can help the users who are not familiar with programming language obtain the results of data analysis easily, a software with a GUI would be user-friendly. However, one disadvantage for a few GUI based systems is the extensibility for the users. The users usually just use the GUI already provided by these systems. It might not be easy for them to create their own GUI incorporated with their methods. To overcome the difficulty, a new framework based on other patterns, referred to as Data Analysis Module framework, is proposed. The UML diagram for the framework can be downloaded.
    The framework can also be thought as a three-tier model with a Template tier, a Module tier and a Concrete tier. The users only need to implement the required methods of the classes in the Concrete tier. These classes can be designed in a way such that the users specify the must to create the GUI. Further, The software developers have to provide suitably designed classes in the other two tiers to achieve the goal to simplify the work for the users. By factoring out common operations for constructing the GUI and developing a module for data analysis, the software developers specify the default methods (may be overridden) and the abstract methods (must be implemented) in the Template tier. The classes in the Module tier are designed to carry out some complex or required operations defined in the Template tier and handle the arguments passed from the Concrete tier.

Infrastructures
    JavaStatSoft consists of several packages. They are
    statsoft which provides based classes used to create statistical modules,
    javastat which provides classes for performing basic statistics,
    statgraphics which provides classes for graphical summary,
    statreport which provides classes for generating formatted reports,
    statdialog which provides classes for creating a variety of dialogs ,
    stathelp which provides classes for developing a help system,
    statcompiler which provides classes for creating a Java compiler loader and the associated GUI,
    free which provides classes for creating a spreadsheet, a database loader and the dialog for the database loader.

Thanks


License

JavaStatSoft