PreviousCompiling and Shipping OO Applications Collection FrameworksNext

Chapter 16: Introduction to the Class Library

Object COBOL is supplied with a class library of predefined classes which you can use and subclass. This chapter introduces you to the Object COBOL Class Library, and tells you how you can find out how to use it.

16.1 Overview

The Object COBOL Class Library provides you with a set of classes to help you write your own applications faster. There are broadly four categories of class in the supplied Class Library:

The Class Library does not yet include classes for handling COBOL files. Object COBOL supports full COBOL file handling syntax, and you can use this in your classes and programs to read and write to COBOL file types. MERANT will only release COBOL file handling classes when satisfied that they provide a worthwhile enhancement to COBOL file handling technology, and that their architecture will allow for further improvements in the future.

There are some references in the Class Library documentation to parts of the Class Library which are private. Wherever something private is documented, this is noted in the text. You should not subclass from private classes, or make use of private methods in your Object COBOL applications. Unless something in the documentation is marked as private, you can assume that it is part of the public interface. Public and private are explained in the sections below.

As well as this documentation, we supply the source code for the Object COBOL class library. We supply this for the following reasons:

16.1.1 Public Interface

The public interface to the Class Library consists of those methods and classes in the Class Library which are intended for use by programmers creating Object COBOL applications.

16.1.2 Private Interface

The private interface to the Class Library consists of those methods and classes not intended for use by programmers using the class library. They are part of the implementation of the class library and are subject to change in future releases.

Private methods are marked as such in the comments to the class library source code.

The private interface also includes all class and instance data in class library objects. You should not make direct use of this data in any subclasses, but should use the methods in the superclass to get access to this data.

16.2 Class Library Documentation

The documentation for the Class Library is split into two:

The frameworks are documented in this manual. The public interface to classes is documented in the Class Library Reference which provides, for every class in the Class Library, a description of:

Private methods are not documented. Methods inherited from Base are not documented as all objects from the Class Library inherit these, except where they have been explicitly overridden. You can see these methods which are common to all objects by looking at the documentation for the Base class.

16.3 Frameworks

Frameworks are the way in which different types of object interact together. Individual class and instance objects have interfaces which describe the way you communicate with that object.

A framework is a protocol used by several different types of object cooperating to implement a particular function. The other chapters in this part of the book document the main frameworks used in this Class Library. The information will help you to use the Class Library efficiently. For example, the chapter Collection Frameworks describes the messages a collection sends to its elements.

16.4 Animating the Class Library

You might want to be able to animate parts of the Class Library, possibly to help you understand how it works, or maybe to help you track down a bug in your own application. We strongly recommend that you only try to animate one or two class library programs at a time from your application.

Object COBOL itself uses the Class Library during start-up, so if you attempt to animate the whole Class Library you might find yourself stepping through code in which you are not interested before your application is loaded.

To animate the class library:

  1. Run the supplied shell script, $COBDIR/src/oops/ to compile the class library for animation.
  2. Set the OOSW environment variable:
    export OOSW

    This switch tells the run-time system not to load the class library supplied with Server Express, but to use the individual class library files you have just compiled. The class library files must either appear on the path set in COBDIR, or in the current directory from which you run your application.

  3. Run your application.

Warning: We strongly advise you not to make changes to the Class Library sources. Implementation details are considered private, and may change between Object COBOL releases. MERANT does not prevent you from making these changes, but cannot guarantee that they will be supported in future releases.

Copyright © 1999 MERANT International Limited. All rights reserved.
This document and the proprietary marks and names used herein are protected by international law.

PreviousCompiling and Shipping OO Applications Collection FrameworksNext