Product SiteDocumentation Site

Chapter 1. Open Object Rexx General Concepts

1.1. What Is Object-Oriented Programming?
1.2. Modularizing Data
1.3. Modeling Objects
1.4. How Objects Interact
1.5. Methods
1.6. Polymorphism
1.7. Classes and Instances
1.8. Data Abstraction
1.9. Subclasses, Superclasses, and Inheritance
1.10. Structure and General Syntax
1.10.1. Characters
1.10.2. Whitespace
1.10.3. Comments
1.10.4. Tokens
1.10.5. Implied Semicolons
1.10.6. Continuations
1.11. Terms, Expressions, and Operators
1.11.1. Terms and Expressions
1.11.2. Operators
1.11.3. Parentheses and Operator Precedence
1.11.4. Message Terms
1.11.5. Message Sequences
1.12. Clauses and Instructions
1.12.1. Null Clauses
1.12.2. Directives
1.12.3. Labels
1.12.4. Instructions
1.12.5. Assignments
1.12.6. Commands
1.13. Assignments and Symbols
1.13.1. Extended Assignments
1.13.2. Constant Symbols
1.13.3. Simple Symbols
1.13.4. Stems
1.13.5. Compound Symbols
1.13.6. Environment Symbols
1.14. Message Instructions
1.15. Commands to External Environments
1.15.1. Environment
1.15.2. Commands
1.16. Using Rexx on Windows and Unix
The Rexx language is particularly suitable for:
  • Application scripting
  • Command procedures
  • Application front ends
  • User-defined macros (such as editor subcommands)
  • Prototyping
  • Personal computing
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.

1.1. 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".