Product Site

Chapter 4. Objects and Classes

4.1. Types of Classes
4.1.1. Object Classes
4.1.2. Mixin Classes
4.1.3. Abstract Classes
4.1.4. Metaclasses
4.2. Creating and Using Classes and Methods
4.2.1. Using Classes
4.2.2. Scope
4.2.3. Defining Instance Methods with SETMETHOD or ENHANCED
4.2.4. Method Names
4.2.5. Default Search Order for Method Selection
4.2.6. Defining an UNKNOWN Method
4.2.7. Changing the Search Order for Methods
4.2.8. Public, Package-Scope, and Private Methods
4.2.9. Initialization
4.2.10. Object Destruction and Uninitialization
4.2.11. Required String Values
4.2.12. Concurrency
4.3. Overview of Classes Provided by Rexx
4.3.1. The Class Hierarchy
4.3.2. Class Library Notes

This chapter provides an overview of the Rexx class structure.

A Rexx object consists of object methods and object variables ("attributes"). Sending a message to an object causes the object to perform some action; a method whose name matches the message name defines the action that is performed. Only an object's methods can access the object variables belonging to an object. EXPOSE instructions within an object's methods specify which object variables the methods will use. Any variables not exposed are local to the method and are dropped on return from a method.

You can create an object by sending a message to a class object—typically a "new" method. An object created from a class is an instance of that class. The methods a class defines for its instances are called the instance methods of that class. These are the object methods that are available for every instance of the class. Classes can also define class methods, which are a class's own object methods.

Note

When referring to instance methods (for objects other than classes) or class methods (for classes), this book uses the term methods when the meaning is clear from the context. When referring to instance methods and class methods of classes, this book uses the qualified terms to avoid possible confusion.