Chapter 25 Key Takeaways

  1. OO COBOL is real COBOL. The COBOL 2002 standard introduced a complete object model — classes, methods, inheritance, interfaces, and object references. This is not a toy feature; it is a fully specified extension of the language.

  2. CLASS-ID replaces PROGRAM-ID as the identification paragraph for class definitions. Classes contain FACTORY and OBJECT sections, which hold class-level and instance-level data and methods, respectively.

  3. The INVOKE statement is OO COBOL's method call mechanism, replacing Java's dot operator. INVOKE obj "Method" USING params RETURNING result is the fundamental pattern.

  4. SELF and SUPER reference the current object and the parent class's methods, analogous to this and super in Java.

  5. The REPOSITORY paragraph acts as a class registry, mapping logical class names to physical implementations — comparable to Java's import statements.

  6. Inheritance uses the INHERITS clause. Override parent methods with METHOD-ID. Name OVERRIDE. The OVERRIDE keyword is mandatory; implicit overriding is not allowed.

  7. Interfaces (INTERFACE-ID) define method contracts without implementations. Classes declare IMPLEMENTS InterfaceName to commit to providing those methods.

  8. Object references (USAGE OBJECT REFERENCE) can be typed (class-specific), interface-typed, or untyped. Typed references provide compile-time checking; untyped references provide maximum flexibility.

  9. Adoption is limited. Micro Focus provides the most complete implementation. IBM Enterprise COBOL has partial support. GnuCOBOL has minimal support. This compiler reality constrains practical adoption.

  10. OO thinking transcends OO syntax. Even without using OO COBOL syntax, you can apply encapsulation (through CALL interfaces), single responsibility (one program per function), and polymorphism (dispatcher patterns) in procedural COBOL.

  11. The decision to adopt OO COBOL depends on compiler support, team skills, timeline constraints, and risk tolerance — not just on whether OO is "better" in the abstract. The human factor is decisive.

  12. The Modernization Spectrum places OO COBOL between procedural COBOL and a full language migration. It offers genuine architectural improvement within the COBOL ecosystem, but limited community support and tooling make it a niche choice.