SOM-based OO COBOL language elements that are changed

When you migrate applications that use SOM-based OO programming to the Java™-based OO programming in Enterprise COBOL, be aware of the following elements that are changed in Enterprise COBOL.

External names
  • External class names that are defined in the REPOSITORY paragraph must be defined with Java naming conventions for fully qualified class names, rather than the CORBA rules of formation for class names.
  • Method names that are specified as literals use Java naming conventions rather than CORBA naming conventions.
INVOKE
Instead of somNew, object instances are created with the syntax:
INVOKE classname NEW ...
METHODS
COBOL methods can override inherited methods and can be overloaded, according to Java rules. However, the OVERRIDE clause is not required or supported on the METHOD-ID paragraph in these cases.
OBJECTS
  • Instead of somNew, object instances are created with the syntax:
    INVOKE classname NEW ...
  • Object instances are freed through Java automatic garbage collection, rather than somFree.
  • Object instance data is initialized through VALUE clauses or user-written initialization methods, rather than with somInit.
  • OBJECT and END OBJECT syntax must be specified unless the class does not specify any object instance data or object instance methods.