Library View Topics Framed Contents Revised Topics Previous Topic Next Topic Search Search ResultsPrevious Topic MatchNext Topic Match Notes List Notes Print Download No PDF Handheld DisconnectedHandheld ConnectedHelp

X 2.2 COBOL Class Definition Structure

X A COBOL class definition describes a class or a metaclass. A class
X definition constitutes a compilation unit.

X Class

X The entity that defines common behavior and implementation for zero,
X one, or more objects. The objects that share the same implementation
X are considered to be objects of the same class.

X Method

X Procedural code that defines one of the operations supported by an
X object, and that is executed by an INVOKE statement on that object.

X Instance Data

X Data defining the state of an object. The instance data introduced by
X a class is defined in the Working-Storage Section of the Data Division
X of the class definition. The state of an object also includes the
X state of the instance variables introduced by bases classes that are
X inherited by the current class. A separate copy of the instance data
X is created for each object instance.

X Subclass

X A class that inherits methods and instance data from another class.
X When two classes in an inheritance relationship are considered
X together, the subclass is the inheritor or inheriting class; the
X super-class is the inheritee or inherited class.

X Metaclass

X A special type of class whose instances are called class-objects.
X Class-objects are the run-time objects that represent SOM(R) classes.
X Any class descended from SOMClass is a metaclass.

X With the exception of the COPY and REPLACE statements and the END CLASS
X header, the statements, entries, paragraphs, and sections of a COBOL class
X definition are grouped into the following four divisions:

X The end of a COBOL class definition is indicated by the END CLASS header.

X Following is the format for the entries and statements that constitute a
X separately-compiled COBOL class definition.

 X  ___ Format--COBOL Class Definition _____________________________________ 
 X |                                                                        |
 X | >>__ _IDENTIFICATION DIVISION._ ___CLASS-ID.__class-name-1___._______> |
 X |     |_ID DIVISION._____________|                                       |
   |                                                                        |
 X | >__ _________________________________ _______________________________> |
 X |    |_identification-division-content_|                                 |
   |                                                                        |
 X | >___ENVIRONMENT DIVISION.__class-environment-division-content________> |
   |                                                                        |
 X | >__ _______________________________________________ _________________> |
 X |    |__DATA DIVISION.__class-data-division-content__|                   |
   |                                                                        |
 X | >__ __________________________________________________ ______________> |
 X |    |__PROCEDURE DIVISION.__ _______________________ __|                |
 X |                            | <___________________  |                   |
 X |                            |___method-definition_|_|                   |
   |                                                                        |
 X | >___END CLASS__class-name-1.________________________________________>< |
   |                                                                        |


X Specifies the end of a class definition.

Previous Topic Next Topic Copyright IBM Corp. 1991, 1998

IBM Library Server Copyright 1989, 2005 IBM Corporation. All rights reserved.

Return to library:   z/OS | z/OS.e | TPF | z/VSE | z/VM | IBM Hardware | IBM System z Redbooks
Glossary:   IBM terminology
Publications:   How to order publications
Readers:   Download IBM Library Reader | Download IBM Softcopy Reader | Download Adobe® Acrobat® Reader®
Library management:   Download IBM Softcopy Librarian
Contacts:   Contact z/OS

Adobe, the Adobe logo, Acrobat, the Acrobat logo, and Acrobat Reader are registered trademarks of Adobe Systems incorporated.