Chapter 14: Introduction to the Class Libraries

This chapter introduces you to the Micro Focus class libraries supplied with your COBOL system, and tells you how you can find out more about them.

Overview

The following class libraries are supplied:

There are some references in the class library documentation to parts of the class libraries that 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 OO 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 class libraries. We supply this for the following reasons:

Public and Private Interfaces

The public interface to the class libraries consists of those methods and classes in the class libraries that are intended for use by programmers creating OO COBOL applications.

The private interface to the class libraries consists of those methods and classes that are not intended for use by programmers using the class library. They are part of the implementation of the class libraries 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.

Class Library Method Parameter Types

Methods in the supplied Micro Focus Class Library consistently use the same COBOL data types for passing integers and boolean values. The table below summarizes these:

Parameter Declare as
Signed integers PIC S9(9) COMP-5.
Unsigned integers PIC X COMP-5
Booleans Booleans, where TRUE is numeric 1 and FALSE is numeric 0.

PIC S9(9) COMP-5 and PIC X(4) COMP-5 are both 4-byte data types.

For consistency, we suggest you adopt these conventions when writing your own classes.

Class Library Documentation

The documentation for the class libraries 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 libraries, a description of:

Private methods are not documented. Methods inherited from Base are not documented as all objects in the Base 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.

From the Net Express Help Contents click Reference > OO Class Library > Class Library Reference, then click the Class Library Reference icon at the foot of the help topic.

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 co-operating to implement a particular function. The other chapters in this part of the book document the main frameworks used in the class libraries. For example, the chapter Collection Frameworks describes the messages a collection sends to its elements.

Debugging the Class Libraries

You might want to be able to debug parts of the class libraries, possibly to help you understand how they work, or maybe to help you track down a bug in your own application. You can debug the following class libraries:

We strongly recommend that you only try to debug one or two class library programs at a time from your application.

The run-time system itself uses the class libraries during startup, so if you attempt to debug a whole class library you might find yourself stepping through code in which you are not interested before your application is loaded.

How to


Copyright © 2009 Micro Focus (IP) Ltd. All rights reserved.