Chapter 1. Open Object Rexx General Concepts

Table of Contents
What Is Object-Oriented Programming?
Modularizing Data
Modeling Objects
How Objects Interact
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 data encapsulation, polymorphism, an object class hierarchy, class-based inheritance of methods, and concurrency. It includes a number of useful base classes and allows you create new object classes of your own.

Open Object Rexx is compatible with earlier Rexx versions, both non-object based Rexx and IBM's Object Rexx. 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. Any indentation scheme 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 size of variable values, as long as all values fit into the storage available. There are no restrictions on the types of data that variables can contain.

A language processor (interpreter) runs Rexx programs. That is, the program runs line by line and word by word, without first being translated to machine language (compiled.) One of the advantages of this is that you can fix the error and rerun the program faster than when using a compiler.

Note: Open Object Rexx also supplies the rexxc program that can be used to tokenize Rexx programs. Tokenizing a program is not the same as compiling a program to machine language. See Appendix A. Distributing Programs without Source of the Open Object Rexx Programming Guide for details on rexxc and tokenizing.

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. Essentially, the objects are the "nouns", while the actions are the "verbs".