OSE - A Development Environment for C++

Graham Dumpleton
Dumpleton Software Consulting Pty Limited
PO BOX 3150
Parramatta, 2124
N.S.W, Australia
email: grahamd@nms.otc.com.au

What is OSE

OSE is a collection of programming tools and class libraries for C++, which have been developed with the aim of improving programmer productivity. Increased productivity is achieved through the ability to reuse software components, and by reducing the time developers need to devote to managing the infrastructure supporting the day to day tasks of programming.

The environment contains three major components. These are the C++ class libraries, a build environment and a set of documentation extraction tools.

The core of the environment is the C++ class libraries. Three libraries are provided. These are:

OTCLIB - A library of generic components, including support for error handling, error message logging, error recovery, program debugging, memory management, resource management, generic collections, text manipulation, operating system interfacing and event driven systems.

OUXLIB - A library of components which primarily extends classes in the OTCLIB library to support features specific to the UNIX operating system.

OTKLIB - A library of components which builds on the OTCLIB and OUXLIB libraries to allow integration of the TCL/TK library into applications using the event driven systems framework provided by the OTCLIB library.

The C++ libraries are portable to a wide range of C++ compilers on the UNIX platform. Supported C++ compilers include those from USL (CFRONT), DEC, HP, IBM, Lucid, SGI, SUN, CenterLine and ObjectStore, as well as the freely available GNU C++ compiler. If your C++ compiler does not support templates, it is possible to use a template preprocessor which is supplied with OSE. Portability to all the major variants of UNIX has been achieved. Supported platforms include BSD, HPUX, IRIX, Linux, OSF, SCO, Solaris, SunOS, SYSV and Ultrix. In addition to being available under UNIX, the OTCLIB library is portable to DOS and OS/2 using Borland and Watcom C++ compilers.

Special care has been taken to ensure that the C++ libraries can be used in conjunction with other C and C++ libraries, as well as various database products. This has been achieved through attention to naming conventions and avoiding common names which are liable to result in conflicts. Third party GUI libraries and products which the C++ libraries have been used with include X Windows, TCL/TK, InterViews, Motif, DataViews and Xdesigner. Third party database products which the C++ libraries have been used with include Oracle, Versant and ObjectStore. Special support has been provided in the C++ libraries to allow instances of classes from the libraries to be made persistent by storing them in an ObjectStore database. Various other miscellaneous libraries have also been used in conjunction with the C++ libraries.

Equally as important as the C++ libraries to improving programmer productivity is the build environment supplied with OSE called "makeit". The build environment consists of a wrapper around GNU make, as well as a predefined set of makefiles. The predefined makefiles have been structured as modules, different modules supporting different features. The developer only includes the modules for the features which are needed. Inclusion of modules into a makefile is facilitated by the "include" mechanism of GNU make. The separation of modules files from the makefile, and the limited number of variables which need to be set to control the build environment, results in simple, uncluttered and easy to understand makefiles.

From the defined variables, the names of the files present in the directory and the rules defined in the modules being used, the build environment can determine automatically what needs to be compiled. The build environment will also use whatever compiler is appropriate for a particular code file, and determine whether the results should be placed into a library, or used to create an executable program.

The build environment provides a range of basic modules supporting commonly used programming tools. Tools supported include C and C++ compilers, and code generators lex, yacc and rpcgen. Special modules exist for combining multiple code libraries into one library, forming template closure on C++ libraries, creation of C++ template repositories, as well as a module handling installation of programs and libraries created by the build environment. Modules for programming languages can accommodate creating both standard library archives and shared libraries. A number of third party products are supported by the build environment. These include Purify, Quantify, Purelink, Sentinel, ObjectCenter, ObjectStore and Versant.

When necessary, the build environment can be extended by inclusion of additional modules. This allows the build environment to be tailored to local requirements without interfering with the core environment.

The documentation extraction tools provided with OSE allow documentation about C++ classes to be embedded within C++ header files as C++ comments. This close link between the documentation and code helps to ensure that documentation is kept up to date. To produce UNIX style manual pages from the embedded comments, the program "class2man" is provided. To generate Frame mml files, the program "class2mml" is provided. All classes in the C++ libraries provided in OSE are documented such that these tools can be used. This has ensured comprehensive documentation on the purpose of all member functions of classes in the C++ libraries exist.

A companion tool to class2man is "class2src". Instead of producing documentation, class2src produces stubs for each member function of a C++ class. This facilitates using C++ class definitions as a design tool, with class2src being used to generate code files stubs when the classes are to be implemented.

A further useful tool which is provided in OSE is "mksrc". This program creates header files and code files, filling out the files with file headers giving the author and copyright details. Code files can also be filled out with test harnesses and program stubs. Local conventions for file headers can easily be accommodated, as can new types of files.