CLASS-ID. Foobar INHERITS SOMObject.The INHERITS clause specifies the base class. All classes inherit directly or indirectly from SOMObject, a built-in generic class.
The INHERITS clause may specify multiple inheritance by listing multiple base classes. The order in which the base classes are listed is significant. When two base classes have methods with the same name, the derived class inherits the method from whichever base class is listed earlier.
REPOSITORY. CLASS SOMObject IS 'SOMObject'
CLASS Foobar IS 'Foobar'
CLASS Barfoo IS 'Barfoo'.
Each CLASS clause maps the name of a class to the name by which it is
known in the Interface Repository (IR). Thus a CLASS clause does for
objects what SELECT...ASSIGN does for files.
In my examples, the internal names match the external names. However, there is probably nothing to stop you from coding CLASS GezorkaPlatz IS 'Foobar'.
A class definition cannot have an INPUT-OUTPUT SECTION, because it cannot allocate any files. Methods, however, may access files.
The PROCEDURE DIVISION consists entirely of method definitions, one after another. Each method definition may have four divisions of its own, including a PROCEDURE DIVISION which performs the actions of the method.
As a result, the entire class definition may contain multiple WORKING-STORAGE sections, multiple PROCEDURE divisions, and so forth. It takes getting used to, especially when you're trying to find your way around in the editor.
END CLASS Foobar.