Compiling and Shipping OO Applications | Collection Frameworks |
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.
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:
Classes such as Base and Behavior which provide basic system support.
Classes for creating objects which manage collections of objects. These are very useful in OO programming.
Classes which enable you to send messages to COBOL data items.
Classes for creating and managing graphical interfaces.
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. Micro Focus 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:
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.
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.
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 on-line Object COBOL Class Library Reference. For every class in the Class Library, the on-line Object COBOL Class Library Reference provides you with:
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.
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 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.
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 startup, 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.
16-bit:
On 16-bit COBOL systems, you might also run into memory problems when trying
to animate many programs at a time.
>>Windows and OS/2 :
To animate the class library
[xm] cobol % omf"gnt";
16-bit:
On 16-bit COBOL systems, you only need to use xm if you are running
on Windows.
This creates native code .gnt files for all the programs in the class library.
[xm] cobol % editor(mf) anim nognt mfoo;
16-bit:
On 16-bit COBOL systems, you only need to use xm if you are running
on Windows.
set oosw=-l
This switch tells the run-time system not to load class.lbr, 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.
>>UNIX:
To animate the class library
OOSW=-l export OOSW
This switch tells the run-time system not to load class.lbr, 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.
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. Micro Focus 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.
Compiling and Shipping OO Applications | Collection Frameworks |