|Object COBOL Concepts|
Object COBOL extends Micro Focus technology to enable object-oriented programming in COBOL, while retaining all the dialects and features previously available. This chapter explains:
If you don't want to use OO you don't need to read this manual, and can use Micro Focus Object COBOL in the same way you used Micro Focus COBOL.
To enable you to write OO programs in COBOL, Micro Focus has added the following components and features to the COBOL system:
Object COBOL has a small amount of new syntax - one new verb (INVOKE), one new data type (OBJECT REFERENCE) and three new types of header paragraph
Adds support for creation of objects, dynamic message binding, and inheritance to the COBOL run-time system
A library of pre-defined objects which you can use as a foundation
for building your own applications
A tool for browsing and editing Object COBOL source code available on windows and OS/2. It provides you with a view of your application which is based on classes and methods.
This manual is intended to help you get started programming with Object COBOL as quickly as possible. However, if you are completely new to OO you might want to do some background reading to familiarize yourself with the new concepts, and perhaps get some training in Object-Oriented Analysis and Design. There is a list of books in the section Reading List.
The next two sections explain:
The list below shows the basic steps to develop an OO application.
>>To develop an OO application
You need to see where inheritance hierarchies will help you to reuse code, and to see which objects will interact between each other and the messages they will send.
Windows and OS/2:
You can use any text editor for coding; we recommend you use the Micro Focus Class Browser. This gives you templates to help you construct classes and methods quickly, and also enables you to navigate methods and classes faster than a conventional editor.
You can use any text editor to code Object COBOL; we recommend the Micro Focus Editor. Alternatively, you can develop and debug your application on Object COBOL or Workbench for Windows NT, and transfer the code to a UNIX platform for production. Apart from GUI programming, which is not supported on UNIX, Object COBOL code is portable between OS/2, Windows NT and UNIX.
Windows and OS/2:
On Windows and OS/2 platforms,the Class Browser provides functions to compile individual classes, a class and its subclasses, or all the programs in your application.
Steps 1 and 2 are OO analysis, and fall outside of the scope of this book. Some information sources to help you get started are provided in the section Learning More About Object-Orientation. The next section explains how you can use the documentation to help you with steps 3 to 8.
When you start developing OO applications with Object COBOL, you learn about three things:
How OO is handled by Object COBOL. There is very little new syntax to learn.
The development environment for OO will be familiar to any previous users of Micro Focus COBOL.
Windows and OS/2:
On Windows and OS/2 you have an additional tool; the Class Browser. This is a GUI tool which simplifies writing and reading Object COBOL source code. It is integrated with Animator V2 and the Object COBOL Compiler.
The Class Library gives you a set of ready-made objects which you can use in your applications. The tutorials in this book give you an introduction to the main types of classes in the Class Library, so that you can get a feel for what is in there. You don't have to know the entire Class Library to begin programming.
This manual is divided into parts for ease of use:
Consists of this chapter and the chapter Object COBOL Concepts. Read the Object COBOL Concepts chapter to get a quick overview of the key points about OO and Object COBOL.
The tutorials show you how to send messages, write classes, and start using the supplied class library. The chapter Object COBOL Tutorials briefly describes the subjects covered in the tutorials, and explains how you use them.
The tutorials in Part II are for Object COBOL on Windows and OS/2, the tutorials in Part III are for Object COBOL on UNIX. Object COBOL syntax and behavior is the same on all environments, but the development environments are different. The Windows and OS/2 tutorials exploit the Class Browser and graphical environment, while the UNIX tutorials are driven from command line tools. Also, the Windows and OS/2 tutorials use the GUI classes which are not available on UNIX.
Refer to the chapters in this section once you start programming.
The first two chapters Using Objects in Programs and Class Programs deal with using and writing Object COBOL classes. If your interest is to be able to use Object COBOL classes supplied by others as building blocks, you only need to read the chapter Using Objects in Programs, but if you are going to write your own classes you need to read both.
The chapter Extending a Class documents a Micro Focus feature for dynamically adding behavior to a class at run-time.
The chapter Requirements-Based Vocabularies shows you how you can extend Object COBOL syntax and define your own verbs and functions for sending messages.
The chapter Debugging Object COBOL Applications explains some of the extra facilities you will find useful in debugging any program which uses Object COBOL classes and objects.
The chapter Compiling, Linking and Shipping OO Applications supplements the information supplied in the other manuals in your Object COBOL documentation set. It will help you get an application ready for delivery to end-users.
Documents the main frameworks provided in the supplied Object COBOL Class Library. The Class Library is a big subject in its own right; the section Exploring the Class Library later in this chapter will help you to find your way around.
Documents the use of objects through Object Request Brokers (ORBs) like SOM and OLE with Object COBOL.
Contains the appendix Descriptions of OO Run-time Switches. This is reference information on switches you can set to alter the behavior of OO applications at run-time.
The glossary contains a list of the new terms introduced by this book.
The Class Library contains public classes and private classes. Private classes are not part of the public interface and are not fully documented - for an explanation of what Micro Focus means by public and private, see the sections Private Interface and Public Interface in the chapter Introduction to the Class Library.
To help you get started with the Class Library, we have provided four sources of information, moving from introductory and "how-to" information, to detailed reference information:
For each class, it gives you a description of its use, and a list of all the public class and instance methods which the class either implements or inherits, except those inherited from Base. All classes inherit the methods in Base, so these are only documented under the description for Base.
Enter the following command line:
cobrun hyhelp ooclib!
Windows and OS/2 :
On Windows and OS/2 you can look through the Class Library sources using the Class Browser. The Class Browser is also very useful for browsing through your own in-house libraries of classes.
The documentation supplied with Object COBOL will help you to start programming in Object COBOL. However, if you are new to OO, learning about the principles of Object-Oriented Design and Analysis (OOD and OOA) will enable you to make the best use of this new technology.
The reading list below suggests some texts you might want to start with. There are also several training organizations who run language-independent courses on OOD and OOA. Additionally, you can get a computer-based training package from Micro Focus Publishing.
Micro Focus Training also runs Object COBOL programming courses.
This is a short list of texts dealing with Object-Oriented methodologies and technologies.
|Grady Booch:||Object-Oriented Design
Benjamin/Cummings, 1994 ISBN: 0-8053-0091-0
|Ivor Jacobson:||Object-Oriented Software Engineering
Addison-Wesley, 1992 ISBN: 0-201-54435-0
|James Rumbaugh:||Object-Oriented Modeling and Design
Prentice Hall, 1991 ISBN: 0-13-629841-9
|Raymond Obin:||Object Orientation - An Introduction for COBOL
Micro Focus Publishing, 1993 ISBN 1-56928-005-3
Aimed at existing COBOL programmers who want to learn about Object-orientation, and also provides a sketch of the forthcoming ANSI extensions to the COBOL language.
|Sally Shlaer and Steve Mellor:||Object-Oriented Systems Analysis: Modeling the
World in Data
Prentice Hall, 1988 ISBN: 0-13-629023-1
|Object Lifecycles: Modeling the World in
Prentice Hall, 1992 ISBN: 0-13-629940-7
|David Taylor:||Object Oriented Information Systems: Planning
John Wiley, ISBN: 0-471-54364-0
Aimed at managers who need to make informed decisions for successful system installation and development.
|Rebecca Wirfs-Brock and B. Wilkerson:||Designing Object-oriented Software|
The following courses have been developed by Object Management Labs and are available through Micro Focus publishing:
For managers and executives needing an overview of object-oriented analysis and design
For programmers and technical managers involved in object-oriented projects.
For programmers wanting to learn OO programming with COBOL.
Copyright © 1999 MERANT International Limited. All rights reserved.
This document and the proprietary marks and names used herein are protected by international law.
|Object COBOL Concepts|