FABLE is the proposed software framework for the Total Crystallography project. The Total Crystallography (TC) project has been officially accepted as a European NEST proposal. This means more resources and more programmers for FABLE. In order to make sure that the code produced by the programmers in the various collaborating institutes can function together it is important to define programming guidelines. This document is a proposal for such guidelines.
The aim of the TC project is to produce working software which can be used online for preparing TC experiments and analysing data online, and which can be distributed to users to continue the analysis of their data at their home institute. The algorithms to be implemented will be defined by the TC team. The goal of this document is to define a common mechanism which will ensure that the code produced in the different institutes works together.
In order to integrate the various codes together it is necessary that they be written as reusable modules and not as monolithic blocks of code which can only run as a standalone programs.
One obvious way to achieve this is that the code in each module be written as a library of routines. In order to be usable as a library a few basic rules must be followed :
All modules will be accessed via their API's. In order to ensure API's are well defined and easily integrated into TC here are some guidelines on how to define API's :
Modules need to be tested. Each module must provide a testsuite of programs which will call each of the API calls and demonstrate their functioning. The test programs can be written in Python, C++/C, Java. A good way of writing testsuites is to use the Unit Test1 framework. Implementations of the Unit Test framework exist for most common languages.
Examples must be provided with each module on how to use the module.
All algorithms and api's must be documented. It is suggestd that the algorithms be documented outside the code (a brief description should be included in the code). API's should be documented in the code using the doxygen2 markup language. The name, function, input and output parameters must be documented.
FABLE will support a subset of commonly used programming languages. These are :
Other languages like Fortran must be wrapped with one of the above languages in order to be integrated in TC. Matlab is envisaged to be used for prototyping algorithms but not as part of the final product.
One of the fundamental aims of TC is to provide users with a user-friendly interface. The graphical user interface (gui) will enable a user to analyse an entire experiment using the user interface. The user interface will call the API's or device servers (in the distributed case) or scripts. The TC gui will be written in Java using the Eclipse Rich Client Platform3 technology.
The user interface is the part of a program a user sees most. She spends most of her time in front of it and uses it to provide input and visualise output from the underlying program(s). The user interface therefore plays a major role for any program. A program is often judged by its user interface.
FABLE must respect the golden rule for developing user interfaces no matter which technology is used :
SEPARATE USER INTERFACE IMPLEMENTATION FROM ALGORITHM IMPLEMENTATION
In simple terms this means do not embed scientific or any other non user interface algorithms in user interface code. Doing so mixes two different domains and makes it very difficult to reuse or refactor the code later on. Usually user interfaces change quicker than algorithms and it is essential to keep the two separate so they can evolve independantly. There are many ways of implementing the user interface. A proposal made today may be obsolete in 5 years.
The FABLE User Interface will be based on the Workbench concept. A workbench is much more than a desktop. It provides useful tools for doing your work and manages the work being done by providing window management, sets of windows to solve specific tasks (perspectives), views, help, tutorials and mechanisms for coordinating tasks. The workbench will make the tasks of simulation, data acquisition, offline and online analysis accessible from one tool. It is proposed that the FABLE user interface be implemented using Eclipse/RCP. The reasons for doing this are outlined on the Eclipse - RCP page.
The User Interface Requirements lists the modules which need to be developed. The [Plugins] page lists the modules which are currently being developed.
Scripting is a fundamental part of TC. It will be possible to analyse an entire experiment using scripts. Python will be the main scripting language.
The TC software will be capable of being distributed over a number of computers in order to increase performance e.g. by using a farm of computers. Distribution of tasks over multiple computers will be done using device servers. Device servers wrappers will be provided for all the modules. The wrappers will call the API's and export their functionality over the network. Data will be shared between processes via shared memory.
Propose to use Nexus with the option to read/write ImageCIF and EDF
Need an input/output library common to all modules
Propose to use MySQL
All code to be stored on Sourceforge4 in CVS. A Fable project already exists. Should we use it or create a new project ? License will be GPL and LGPL
In order to develop TC software it is recommended to install the following software :
Wiki: User Interface Requirements
Wiki: developers - coding rules
Wiki: space.menu