Chapter 1. Object Rexx General Concepts

Table of Contents
What Is Object-Oriented Programming?
Modularizing Data
Modeling Objects
How Objects Interact
Methods
Polymorphism
Classes and Instances
Data Abstraction
Subclasses, Superclasses, and Inheritance
Structure and General Syntax
Terms, Expressions, and Operators
Clauses and Instructions
Assignments and Symbols
Message Instructions
Commands to External Environments
Using Rexx on Windows and Unix

The Rexx language is particularly suitable for:

As an object-oriented language, Rexx provides, for example, data encapsulation, polymorphism, an object class hierarchy, class-based inheritance of methods, and concurrency. Object Rexx is compatible with earlier Rexx versions. It has the usual structured-programming instructions, for example IF, SELECT, DO WHILE, and LEAVE, and a number of useful built-in functions.

The language imposes few restrictions on the program format. There can be more than one clause on a line, or a single clause can occupy more than one line. Indentation is allowed. You can, therefore, code programs in a format that emphasizes their structure, making them easier to read.

There is no limit to the length of the values of variables, as long as all variables fit into the storage available. There are no restrictions on the types of data that variables can contain.

The limit on the length of symbols (variable names) is 250 characters. You can use compound symbols, such as

NAME.Y.Z

where Y and Z can be the names of variables or can be constant symbols, for constructing arrays and for other purposes.

A language processor (interpreter) runs Rexx programs. That is, the program runs line by line and word by word, without first being translated to another form (compiled). The advantage of this is that you can fix the error and rerun the program faster than with a compiler.

What Is Object-Oriented Programming?

Object-oriented programming is a way to write computer programs by focusing not on the instructions and operations a program uses to manipulate data, but on the data itself. First, the program simulates, or models, objects in the physical world as closely as possible. Then the objects interact with each other to produce the desired result.

Real-world objects, such as a company's employees, money in a bank account, or a report, are stored as data so the computer can act upon it. For example, when you print a report, print is the action and report is the object acted upon. Often several actions apply; you could also send or erase the report.