      $set repository(update on checking on)
      *-----------------------------------------------------------------
       class-id. Person as "Person" inherits from Base.

       repository.
           class Person as "Person"
           class CharString as "String"
           class Base as "base"
           interface Displayable as "Displayable"
           .

       factory.

      *---------------------------------------------
      *
      * newPerson: Allocates a new object reference and invokes
      *   initPerson to initialize the new instance
      *
      *---------------------------------------------

       method-id. "newPerson".
       data division.
       linkage section.
       01  lk-personName pic x any length.
       01  lk-dob        pic x any length.
       01  new-object   usage object reference active-class.
       procedure division using lk-personName lk-dob
                          returning new-object.
           invoke super "new" returning new-object
           invoke new-object "initperson" using lk-personName
                                                lk-dob
           exit method
           .
       end method "newPerson".

       end factory.

      *-----------------------------------------------------------------

       object. implements Displayable.
       working-storage section.
       01  personName usage object reference CharString property no set.
       01  dob        usage object reference CharString property no set.

      *---------------------------------------------
      * initPerson: initialize the new instance
      *
      *---------------------------------------------
       method-id. "initPerson".
       linkage section.
       01  lk-personName pic x any length.
       01  lk-dob        pic x any length.
       procedure division using lk-personName lk-dob.
           move CharString::"newstring"(lk-personname) to persoNname
           move CharString::"newstring"(lk-dob) to dob
           exit method.

       end method "initPerson".

      *---------------------------------------------
      *
      * finalize: free resources used for this class
      *
      *---------------------------------------------

       method-id. "finalize".
       procedure division.
           invoke personName "finalize"
           invoke dob "finalize"
           exit method.
       end method "finalize".

      *---------------------------------------------
      *
      * display: display person's details on one line
      *
      *---------------------------------------------

       method-id. "display".
       procedure division.
           invoke personName "display"
           display " " with no advancing
           invoke dob "displaynl"
           exit method.
       end method "display".

       end object.

       end class Person.

