---
rexxpub:
  defaults: rony.yaml
  logo: rexx
---

<!-- 040_ooRexx_V07.odp (2026-10-15 09:35) -->

<!-- slide # 1 (2026-10-15 09:35) ----------------------------- ODP slide # 1 -->
. slide cover
# Procedural and Object-oriented Programming 4

. subtitle
**Abstract Datatype, Classes, Methods, Attributes, Messages, Scopes, Generalizing Class Hierarchy, Inheritance**

. cover-art
. picture img/040_ooRexx_V07/p01-diagram-7.png

<!-- slide # 2 (2026-10-15 09:35) ----------------------------- ODP slide # 2 -->
# Datatype (DT)

- What is a datatype?
    . after
    - Examples from school?
. click
- What gets determined with a datatype?
. click
- What is an abstract datatype (ADT)?

<!-- slide # 3 (2026-10-15 09:35) ----------------------------- ODP slide # 3 -->
# Datatype (DT)

- A datatype determines
    . click
    - The allowable values
    . after
    - The operations that can be carried out with these values
. click
- Abstract datatype (ADT)
    - A generalized description/definition ("schema") of a datatype
    . after
    - Defines the allowable values in general terms
    . with
    - Defines the operations that can be carried out in general terms

<!-- slide # 4 (2026-10-15 09:35) ----------------------------- ODP slide # 4 -->
# Datatype (DT)

- Examples
    . after
    - Datatype **Birthday**
        - E.g. defines a valid **date** and a valid **time** attribute (field), i.e. a structure
        - Allowable operations, e.g. **change/query** the values of the stored date and time, **calculate differences**, e.g. how many years have passed since the birthday
    . click
    - Datatype **Person**
        - E.g. defines **first name**, **family name**, **salary** attributes (fields), i.e. a structure
        - Allowable operations, e.g. **changing/querying** the values for first name, family name, salary, **increase salary**
. click
- Problem in Classic Rexx
    . after
    - No means to explicitly define structures to represent and name a datatype
    . click
    - No means to explicitly define operations for a specific datatype only

<!-- slide # 5 (2026-10-15 09:35) ----------------------------- ODP slide # 5 -->
# Possible Solution 1: Encoding with Strings

. after
- Encoding of data of type **Birthday**
    - `"20050901 16:00"`
    - `"20080229 19:19"`
. click
- Encoding of data of type **Person**
    - `"Albert Einstein 45000"`
    - `"Vera Withanyname 25000"`
. click
- Processing only possible if the following is known to *everyone*
    . after
    - **Number** and **sequence** of the DT attributes (fields)
    . click
    - **Dimension** of the columns (variable, fixed width)
    . click
    - For instance encoded ASCII-files could be encoded as
        . after
        - Fixed column width: each attribute (field) starts at the same position (column)
        . click
        - Variable column width: a separating (delimiting) character necessary between attributes
            . after
            - E.g. a blank or using "comma-separated values (CSV)" to separate attribute  (field) values

<!-- slide # 6 (2026-10-15 09:35) ----------------------------- ODP slide # 6 -->
. slide reference="Cf. rexxref.pdf (1.13.4. Stems)"
# Possible Solution 2: Encoding with Stems

. after
- Data of type **Birthday**
    - Encoding of data in a string, storing a collection with a stem (**birth.**)

      . with
      ```rexx
      birth.1 = "20320901 16:00"
      birth.2 = "20360229 19:19"
      ```

        . after
        - Processing only possible if one knows the **number**, **sequence** and **width** of the values representing the DT attributes (fields), e.g. **SysFileTree()**
    . click
    - Structuring and collecting of data with a stem (birth.) and indexes (**eDate**, **eTime**)

      . with
      ```rexx
      birth.1.eDate = "20320901"
      birth.1.eTime = "16:00"
      birth.2.eDate = "20360229"
      birth.2.eTime = "19:19"
      ```

        . after
        - Processing already possible, if one knows **only** the identifiers (indexes) of the individual DT attributes (fields)!

<!-- slide # 7 (2026-10-15 09:35) ----------------------------- ODP slide # 7 -->
. slide reference="Cf. rexxref.pdf (1.13.4. Stems)"
# Possible Solution 3: Encoding with Stems

. after
- Data of type **Person**
    - **Structuring** with the help of stems

      . with
      ```rexx
      pers.eFirstName = "Albert"
      pers.eLastName = "Einstein"
      pers.eSalary = "45000"
      ```

      [and]{.fragment .afterPrevious}

      . with
      ```rexx
      pers.eFirstName = "Vera"
      pers.eLastName = "Withanyname"
      pers.eSalary = "25000"
      ```

. click
- If using stems one must introduce an additional index (e.g. a number) in order to be able to store both persons above, independent of each other!
    . click
    - **Otherwise the latter assignments (**`"Vera" …`**) would replace ("**overwrite**") the first ones (**`"Albert" …)`**!**

<!-- slide # 8 (2026-10-15 09:35) ----------------------------- ODP slide # 8 -->
# Discussion of Possible Solutions

. after
- DT structure
    - Encoding in strings and stems
        - Crook, as implementation dependent!
        - Error prone
. click
- DT operations
    - No possibility to define operations for datatypes!
        - Internal routines (Functions or procedures) must be defined on their own
        - Direct access to strings and stems *must* be realized via **EXPOSE** statements
            - Problems with scopes, source of errors
. click
- Insulating ("Encapsulating") of individual DT extensions ("instances") not possible

<!-- slide # 9 (2026-10-15 09:35) ----------------------------- ODP slide # 9 -->
. slide logo=oorexx reference="Cf. rexxref.pdf (3.3. ::CLASS)"
# Abstract Datatype (ADT)

. after steps
- Implementing an ADT schema with ooRexx
    - `::CLASS`{.rexx} directive
        - Definition of **attributes** (fields) and therefore the internal datastructure
            - `::ATTRIBUTE`{.rexx} directive, or
            - **EXPOSE** statement denoting attributes (fields) ***within*** methods
        - Definition of **operations** (method routines)
            . after
            - `::METHOD`{.rexx} directive
- Instances ("values", "objects") of datatypes ("classes", "types")
    . static
    - Individual, unambiguously distinguishable instantiations of the same type
    - Possess all the same attributes (constitute the datastructure as defined in the class) and operations ("methods of the class")

<!-- slide # 10 (2026-10-15 09:35) --------------------------- ODP slide # 10 -->
. slide reference="Cf. rexxref.pdf (3.3. ::CLASS)"
# Definition of an Abstract Datatype (ADT)

. steps
- Object Rexx implementation of the ADT **Birthday**

  . after
  ```rexx
  /**/
  ::CLASS Birthday
  ::ATTRIBUTE date
  ::ATTRIBUTE time
  ```

- Object
    . static
    - Instance (extension, value) of an ADT, i.e., of a class
        . after
        - Uniquely distinguishable from other objects (even) of the same type
    - Creation: sending the message **NEW** to a class
        - Accessing the class via its environment symbol
            . after
            - Dot, immediately followed by the class identifier (name of the class), e.g.

              . click
              ```rexx
              object1 = .String~NEW("hallo")          /* Object Rexx version */
              object2 = "hallo"                       /* classic Rexx version */
              ```

<!-- slide # 11 (2026-10-15 09:35) --------------------------- ODP slide # 11 -->
. slide reference="Cf. rexxref.pdf (1.11.4. Message Terms)"
# Object Rexx Messages

. after steps
- Conceptually, objects are regarded to be living things in ooRexx with which one communicates using messages! :)
    - If an object receives a message (with or without arguments) it
        . after
        - Searches for a method by the name of the received message in its class
            - If found, it invokes the method, supplying the received message arguments, if any, and returns any value the method may have returned
            - If not found the object searches the class hierarchy to find and invoke the method as described above
                - If there is no method found by the object it will raise a runtime condition with the error message `"Object does not understand message"` and the interpreter stops the execution of the program
    - A message term consists at least of the receiving object, the message operator (**\~**) and the message name to be sent to the object, e.g.

      . click
      ```rexx
      object = .birthday~new
      ```

<!-- slide # 12 (2026-10-15 09:35) --------------------------- ODP slide # 12 -->
. slide reference="Cf. rexxref.pdf (1.11.4. Message Terms)"
# Object Rexx Messages

. steps
. static
- Interaction (activating of methods) with objects (instances, values) is *only* possible via messages
    - Names of messages are the names of the methods, that the object must find and invoke on behalf of the programmer
    - Message operator ("twiddle") is the tilde character: **\~**
        . static
        - `"ABC"~REVERSE`{.rexx} yields: `CBA`
    - "Cascading" messages, two twiddles: **\~\~**
        . static
        - `"ABC"~~REVERSE`{.rexx} yields (*attention!*): `ABC`
        - Sent messages activate the respective methods of the receiving object, however, upon return the interpreter changes the result to be *always* the receiving object!
            - Therefore multiple messages intended for the same object can be "cascaded" one after the other ("cascading messages) by using two tildes (**\~\~**)
    - Execution (resolution) of messages: from left to right

<!-- slide # 13 (2026-10-15 09:35) --------------------------- ODP slide # 13 -->
. slide reference="Cf. rexxref.pdf (1.11.4. Message Terms)"
# Using of an Abstract Datatype (ADT)

- Object Rexx implementation of the ADT **Birthday**

  . after
  ```rexx
  /**/
  g1 = .Birthday~New
  g1~Date= "20320901"
  g1~Time= "16:00"
  g2=.Birthday~New~~"Date="("20360229")~~"Time="("19:19")
  SAY g1~date g2~date g1~time g2~time

  ::CLASS Birthday
  ::ATTRIBUTE date
  ::ATTRIBUTE time
  ```

  . click label
  Output:

  . after
  ```output
  20320901 20360229 16:00 19:19
  ```

<!-- slide # 14 (2026-10-15 09:35) --------------------------- ODP slide # 14 -->
. slide reference="Cf. rexxref.pdf (1.11.4. Message Terms)"
# Using of an Abstract Datatype (ADT)

- Object Rexx implementation of the ADT **Birthday**

  . click mark 5 ".Birthday~New" pen=1
  ```rexx
  /**/
  g1 = .Birthday~New
  g1~Date= "20320901"
  g1~Time= "16:00"
  g2=.Birthday~New    ~~"Date="("20360229")  ~~"Time="("19:19")
  SAY g1~date g2~date g1~time g2~time

  ::CLASS Birthday
  ::ATTRIBUTE date
  ::ATTRIBUTE time
  ```

  . label
  Output:

  ```output
  20320901 20360229 16:00 19:19
  ```

<!-- slide # 15 (2026-10-15 09:35) --------------------------- ODP slide # 15 -->
# Scope

- **Scope:** Determines the visibility of labels, variables, classes, routines, methods and attributes
. click
- **"Standard Scope"**
    - Determines which labels are visible
        . after
        - Labels are only visible within a program (until the end of the program or until the first directive led in by a double colon **::**, whatever comes first)
        . after
        - Labels within of `::ROUTINE`{.rexx} and `::METHOD`{.rexx} directives are only visible within these directives

<!-- slide # 16 (2026-10-15 09:35) --------------------------- ODP slide # 16 -->
# Scope

- **"Procedure Scope"**
    . after
    - Determines, which variables of the caller are visible (accessible) from within the called internal routine (procedure/function)
        . click
        - Internal routines (labels), **without** a **PROCEDURE** statement
            - All variables of the calling part of the program are accessible
        . click
        - Internal routines (labels), followed by a **PROCEDURE** statement
            - Variables of the calling part of the program are **not** accessible (are hidden)
                - ["**Local scope**"]{.fragment}\
                  [*However*: with the help of the **EXPOSE** subkeyword on a **PROCEDURE** statement one can deliberately define direct access to variables of the calling part of the program]{.fragment}

<!-- slide # 17 (2026-10-15 09:35) --------------------------- ODP slide # 17 -->
# Scope

- **"Program/Package Scope"**
    - Determines that all classes and routines defined in a program are accessible
        - **Local classes** and **routines** cannot be hidden/overwritten
        - Classes and routines can be defined to be **public**
    - In addition, this scope determines, that public classes and public routines of called or required (`::REQUIRES`{.rexx} directive) programs become accessible
        - Attention!
            - If different programs are called one after the after, and contain public classes or public routines with the same names, then those classes/routines are accessible that are defined in the last called program

<!-- slide # 18 (2026-10-15 09:35) --------------------------- ODP slide # 18 -->
# Scope

- **"Routine Scope"**
    . after
    - Defines its own scope for
        - Labels ("standard scope") and
        - Variables ("procedure scope")
    . click
    - Accessing classes and routines is determined by the "program/package scope"

<!-- slide # 19 (2026-10-15 09:35) --------------------------- ODP slide # 19 -->
# Scope

- **"Method Scope"**
    - Defines its own scope for
        - Labels ("standard scope") and
        - Variables ("procedure scope")
    - Accessing classes and routines is determined by the "program/package scope"
    - Direct access to attributes
        - Within a method it is possible to use the **EXPOSE** statement (must be the first statement in the method routine) to list those attributes of the class which should be made directly available for access from within the method routine

<!-- slide # 20 (2026-10-15 09:35) --------------------------- ODP slide # 20 -->
# Scope

. steps each=after
. static
- **"Method Scope" (continued)**
    - Determines which attributes can be accessed directly from within a method
    . click
    - There are two types of methods which determine the accessibility of attributes
        . click
        - Methods that are assigned to classes
            - Method and attribute directives defined after a class directive get assigned to that class
            - Expose and share the same set of instance/object attributes
        . click
        - "Floating methods" (advanced concept, can be used for dynamic programming)
            - Methods which are defined before a class directive are called "floating methods"
            - All floating methods can expose and share the same attributes with each other
            - Hint: accessing floating methods is possible via the environment symbol **.METHODS** from within the program where they are defined

<!-- slide # 21 (2026-10-15 09:35) --------------------------- ODP slide # 21 -->
# Overview of Scopes

. steps each=after
- Rexx und Object Rexx
    - Standard scope
        - Labels, variables
    - Procedure scope
        - Variables in internal routines (procedures/functions)
- Object Rexx
    - Program/Package scope
        - Accessing local and public classes and routines of called/required programs/packages
    - Routine scope
        - Standard+procedure+program/package scope
    - Method scope
        - Standard+procedure+program plus accessibility of attributes
            - Methods assigned to a class: methods, which are defined for a class ("instance/object attributes")
            - Floating methods: methods, which are defined before any class directive ("floating attributes")

<!-- slide # 22 (2026-10-15 09:35) --------------------------- ODP slide # 22 -->
# Abstract Datatype "Person"

```rexx
/**/
p1 = .Person~New; p1~firstName= "Albert";
p1~familyName= "Einstein"; p1~salary=45000
p2=.Person~New~~"firstName="("Vera")~~"salary="("25000")
p2~~"familyName="("Withanyname")
SAY p1~firstName p1~familyName p1~salary
SAY p2~firstName p2~familyName p2~salary
SAY "Total costs of salaries:" p1~salary + p2~salary

::CLASS  Person
::ATTRIBUTE firstName
::ATTRIBUTE familyName
::ATTRIBUTE salary
```

. with group
. click label
Output:

. end group

. after
```output
Albert Einstein 45000
Vera Withanyname 25000
Total costs of salaries: 70000
```

<!-- slide # 23 (2026-10-15 09:35) --------------------------- ODP slide # 23 -->
# Abstract Datatype "Person"

. click mark 12-15 pen=1
. click mark 7 pen=2
```rexx
/**/
p1 = .Person~New; p1~firstName= "Albert";
p1~familyName= "Einstein"; p1~salary= "45000"
p2=.Person~New~~"firstName="("Vera")~~"salary="(25000)
p2~~"familyName="("Withanyname")
SAY p1~firstName p1~familyName p1~salary p2~firstName
SAY p1~firstName p1~salary p1~~increaseSalary(10000)~salary
::CLASS  Person
::ATTRIBUTE firstName
::ATTRIBUTE familyName
::ATTRIBUTE salary
::METHOD increaseSalary
  EXPOSE salary
  USE ARG increase
  salary = salary + increase
```

. click label
Output:

. after
```output
Albert Einstein 45000 Vera
Albert 45000 55000
```

<!-- slide # 24 (2026-10-15 09:35) --------------------------- ODP slide # 24 -->
# Abstract Datatype "Person", 3
# (Without Cascading Message)

. click mark 14-17 pen=1
. click mark 7-9 pen=2
```rexx
/**/
p1 = .Person~New; p1~firstName= "Albert";
p1~familyName= "Einstein"; p1~salary= "45000"
p2=.Person~New~~"firstName="("Vera")~~"salary="(25000)
p2~~"familyName="("Withanyname")
SAY p1~firstName p1~familyName p1~salary p2~firstName
tmpSalary=p1~salary
p1~increaseSalary(10000)
SAY p1~firstName tmpSalary p1~salary
::CLASS  Person
::ATTRIBUTE firstName
::ATTRIBUTE familyName
::ATTRIBUTE salary
::METHOD increaseSalary
  EXPOSE salary
  USE ARG increase
  salary = salary + increase
```

. click label
Output:

. after
```output
Albert Einstein 45000 Vera
Albert 45000 55000
```

<!-- slide # 25 (2026-10-15 09:35) --------------------------- ODP slide # 25 -->
. slide reference="Cf. rexxref.pdf (4.2.9. Initialization)"
# Creating Objects

. steps
. static
- Creating (constructing) new objects (values, instances) can be done by sending the **NEW** message to a class
    - The **NEW** method will create the new object (instance, value) and will send it the message **INIT** to allow it to initialise
        - If the **NEW** message has arguments, they get forwarded with the **INIT** message in the same order
    - The **NEW** method returns the reference to the newly created object (instance, value) as its result
- Hence, if we define an **INIT** method for a class, we can use it to initialise an object immediately after it got created (constructed)
    . after
    - The **INIT** method is therefore also called "***constructor***"

<!-- slide # 26 (2026-10-15 09:35) --------------------------- ODP slide # 26 -->
. slide kicker="Abstract Datatype “Person”, 2" reference="Cf. rexxref.pdf (4.2.9. Initialization)"
# Constructor

. after mark 7-9 pen=1
. click mark 2-3 pen=2
```rexx
/**/
p1 = .Person~New("Albert","Einstein","45000")
p2 = .Person~New("Vera","Withanyname",25000)
SAY p1~firstName p1~familyName p1~salary p2~firstName
SAY p1~firstName p1~salary p1~~increaseSalary(10000)~salary
::CLASS  Person
::METHOD INIT
  EXPOSE  firstName  familyName  salary
  USE ARG firstName, familyName, salary
::ATTRIBUTE firstName
::ATTRIBUTE familyName
::ATTRIBUTE salary
::METHOD increaseSalary
  EXPOSE salary
  USE ARG increase
  salary = salary + increase
```

. click label
Output:

. after
```output
Albert Einstein 45000 Vera
Albert 45000 55000
```

<!-- slide # 27 (2026-10-15 09:35) --------------------------- ODP slide # 27 -->
. slide reference="Cf. rexxref.pdf (4.2.10. Object Destruction and Uninitialization)"
# Deleting of Objects

- Objects are automatically deleted from the runtime system, if they are not referenced anymore (becoming "garbage")
    . click
    - *If* there is a method named **UNINIT** defined for a class, then this method will be invoked, right before the unreferenced object gets deleted by the garbage collector by sendig it the **UNINIT** message.
. click
- The **UNINIT** method is therefore called "***destructor***"

<!-- slide # 28 (2026-10-15 09:35) --------------------------- ODP slide # 28 -->
. slide reference="Cf. rexxref.pdf (2.5. DROP)"
# The Rexx "DROP" statement

- **DROP** statement
    . click
    - The **DROP** statement allows the explicit deletion of a variable
    . click
    - If a variable is destroyed its reference to an existing object is removed
        . after
        - There is still the possibility that there are other variables that reference such an object

<!-- slide # 29 (2026-10-15 09:35) --------------------------- ODP slide # 29 -->
. slide kicker="Abstract Datatype “Person”"
# Destructor

. click mark 11-13 pen=1
. click mark 6 "DROP p1; DROP p2;" pen=2
```rexx
/**/
p1 = .Person~New("Albert","Einstein","45000")
p2 = .Person~New("Vera","Withanyname",25000)
SAY p1~firstName p1~familyName p1~salary p2~firstName
SAY p1~firstName p1~salary p1~~increaseSalary(10000)~salary
DROP p1; DROP p2; CALL SysSleep( 15 ); SAY "Finish."
::CLASS  Person
::METHOD INIT
  EXPOSE  firstName familyName salary
  USE ARG firstName, familyName, salary
::METHOD UNINIT
  EXPOSE  firstName familyName salary
  SAY  "Object: <"firstName familyName salary"> is about to be destroyed."
::ATTRIBUTE firstName
::ATTRIBUTE familyName
::ATTRIBUTE salary
::METHOD increaseSalary
  EXPOSE salary
  USE ARG increase
  salary = salary + increase
```

[Output (maybe as uninit may run at different times):]{.fragment}

. after
. after mark 3 pen=3
. with mark 5 pen=3
```output
Albert Einstein 45000 Vera
Albert 45000 55000
Object: <Vera Withanyname 25000> is about to be destroyed.
Finish.
Object: <Albert Einstein 55000> is about to be destroyed.
```

<!-- slide # 30 (2026-10-15 09:35) --------------------------- ODP slide # 30 -->
# Abstract Datatype (ADT) - Roundup

. steps each=after
- Abstract datatype
    - **Schema** for the implementation of datatypes
        - Definition of **Attributes –** Results in the data structure
        - Definition of **Operations** (“Behaviour”) – Method routines (Functions, Procedures)
. click
- Internal datastructures and values are
    - Not visible from the "outside"
    - Not directly editable from the "outside"
    - **Encapsulation !**
. click
- **Schema** must be implemented in an *appropriate* Programming language
    - Classic Rexx is not really *appropriate* for this
    - Object Rexx is - as any other object-oriented - programming language appropriate

<!-- slide # 31 (2026-10-15 09:35) --------------------------- ODP slide # 31 -->
# Classification Tree

. steps
. static
- Generalization Hierarchy, "Classification Tree"
    - Allows **classification of instances** (Objects), e.g. from biology
    - **Ordering of classes in superclasses and subclasses** (schemata)
        . after
        - Subordered classes ("subclasses") **inherit** all properties of all superclasses up to and including the root class
        - Subclasses **specialize** in one way or the other the superclass(es)
            . after
            - "Defining of differences"
    - Sometimes it may make sense, that a subclass specializes directly more than one superclass at the same time ("**multiple inheritance**")
        - Example: Classes representing landborne and waterborne animals, where there exists a class "amphibians", which inherits directly from the landborne and waterborne animals

<!-- slide # 32 (2026-10-15 09:35) --------------------------- ODP slide # 32 -->
# Classification Tree

. after steps
- Prefabricated "class tree"
    - Root class of Object Rexx is named **Object**
    - All user defined classes are assumed to specialize the class **Object**, if no superclass is explicitly given
    - Single and multiple inheritance possible

<!-- slide # 33 (2026-10-15 09:35) --------------------------- ODP slide # 33 -->
# Classification Tree: Search Order

. after steps
- Conceptually, the object receiving a message, starts searching for a method by the name of the received message and if found invokes it with the supplied arguments
- If such a method is not found in the class, from which the object is created, then the search is continued in the direct superclass up to and including the root class **Object**
- If the method is not even found in the root class **Object**, then an error condition gets thrown (`"Object does not understand message"`)
    - If there is a method named **UNKNOWN** defined, then instead of creating an exception the runtime system will invoke that method, supplying the name of the unknown method and its arguments, if any were supplied with the message

<!-- slide # 34 (2026-10-15 09:35) --------------------------- ODP slide # 34 -->
# Classification Tree: Search Order

- [For the purpose of searching there are special, pre-set variables]{.fragment .afterPrevious}\
  which are *only available from within methods*
    . click
    - **super**
        - Always contains a reference to the immediate superclass
        - Allows re-routing the starting class for searching for methods to the superclass
    . click
    - **self**
        - Always contains a reference to the object for which the method got invoked
        - This way it becomes possible to send messages to the object from within a method
. click
- **super** and **self** determine the class, where the search for methods starts which carry the same name as the message

<!-- slide # 35 (2026-10-15 09:35) --------------------------- ODP slide # 35 -->
# Example "Dog"

. steps each=after
. static
- Problem description
    . click
    - "Animal SIG" keeping dogs
        - Normal dogs
        - Little dogs
        - Big dogs
    . click
    - All dogs possess a name and are able to bark
        - Normal dogs bark "**Wuff Wuff**"
        - Little dogs bark "**wuuf**"
        - Big dogs bark "**WUFFF! WUFFF!! WUFFF!!!**"
    . click
    - Define appropriate classes taking advantage of inheritance (search order)

<!-- slide # 36 (2026-10-15 09:35) --------------------------- ODP slide # 36 -->
# Example "Dog"

- Definition of a class "**Dog**", which possess all properties which are common to all types of dogs

  ```rexx
  /**/
  h1 = .Dog ~NEW ~~"NAME="("Sweety") ~~Bark

  ::CLASS  Dog
  ::ATTRIBUTE Name
  ::METHOD Bark
    SAY self~Name":" "Wuff Wuff"
  ```

  . click label
  Output:

  . after
  ```output
  Sweety: Wuff Wuff
  ```

<!-- slide # 37 (2026-10-15 09:35) --------------------------- ODP slide # 37 -->
# Example "Dog"

- Definition of a class "**BigDog**", which possesses all properties common to all big dogs

  . after mark 4 8 pen=1
  ```rexx
  /**/
  h1 = .Dog    ~NEW ~~"NAME="("Sweety")  ~~Bark
       .BigDog ~NEW ~~"NAME="("Grobian")  ~Bark
  ::CLASS  Dog    SUBCLASS Object
  ::ATTRIBUTE Name
  ::METHOD Bark
    SAY self~Name":" "Wuff Wuff"
  ::CLASS  BigDog SUBCLASS dog
  ::METHOD Bark
    SAY self~Name":" "WUFFF! WUFFF!! WUFFF!!!"
  ```

  . click label
  Output:

  . after
  ```output
  Sweety: Wuff Wuff
  Grobian: WUFFF! WUFFF!! WUFFF!!!
  ```

<!-- slide # 38 (2026-10-15 09:35) --------------------------- ODP slide # 38 -->
# Example "Dog"

- Definition of a class "**LittleDog**", which possesses all properties common to all little dogs

  . after mark 5 12 9 pen=1
  ```rexx
  /**/
  .Dog~NEW       ~~"NAME="("Sweety")  ~Bark
  .BigDog~NEW    ~~"NAME="("Grobian") ~Bark
  .LittleDog~NEW ~~"NAME="("Arnie")   ~Bark
  ::CLASS  Dog
  ::ATTRIBUTE Name
  ::METHOD Bark
    SAY self~Name":" "Wuff Wuff"
  ::CLASS  BigDog    SUBCLASS dog
  ::METHOD Bark
    SAY self~Name":" "WUFFF! WUFFF!! WUFFF!!!"
  ::CLASS  LittleDog SUBCLASS dog
  ::METHOD Bark
    SAY self~Name":" "wuuf"
  ```

  . click label
  Output:

  . after
  ```output
  Sweety: Wuff Wuff
  Grobian: WUFFF! WUFFF!! WUFFF!!!
  Arnie: wuuf
  ```

<!-- slide # 39 (2026-10-15 09:35) --------------------------- ODP slide # 39 -->
# Example "Dog", 4

- Definition of a class "**LittleDog**", which possesses all properties common to all little dogs

  . after mark 5 12 9 pen=1
  ```rexx
  /**/
  .Dog~NEW       ~~"NAME="("Sweety")  ~Bark
  .BigDog~NEW    ~~"NAME="("Grobian") ~Bark
  .LittleDog~NEW ~~"NAME="("Arnie")   ~Bark
  ::CLASS  Dog         SUBCLASS Object
  ::ATTRIBUTE Name
  ::METHOD Bark
    SAY self~Name":" "Wuff Wuff" "-" self
  ::CLASS  BigDog      SUBCLASS dog
  ::METHOD Bark
    SAY self~Name":" "WUFFF! WUFFF!! WUFFF!!!" "-" self
  ::CLASS  "LittleDog" SUBCLASS dog
  ::METHOD Bark
    SAY self~Name":" "wuuf" "-" self
  ```

  . click label
  Output:

  . after
  ```output
  Sweety: Wuff Wuff - a DOG
  Grobian: WUFFF! WUFFF!! WUFFF!!! - a BIGDOG
  Arnie: wuuf - a LittleDog
  ```

<!-- slide # 40 (2026-10-15 09:35) --------------------------- ODP slide # 40 -->
# Multithreading

. after
- Multithreading
    - Multiple parts of a program execute at the same time (in parallel)
    . click
    - Possible problems
        - Data integrity (Object integrity)
        - Deadlocks
. click
- Object Rexx
    . click
    - **Inter** Object-Multithreading
        - Different objects (even of one and the same class) are sheltered from each other and can be active at the same time
    . click
    - **Intra** Object-Multithreading
        - ***Within*** an instance (an object) multiple methods can execute at the same time, if they are defined in *different classes*

<!-- slide # 41 (2026-10-15 09:35) ----------- business card (not in the ODP) -->
. slide card logo=none
# Contact