www.delorie.com/gnu/docs/gforth/gforth_157.html   search  
Buy GNU books!

Gforth Manual

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

5.21.2 Object-Oriented Terminology

This section is mainly for reference, so you don't have to understand all of it right away. The terminology is mainly Smalltalk-inspired. In short:

a data structure definition with some extras.

an instance of the data structure described by the class definition.

instance variables
fields of the data structure.

(or method selector) a word (e.g., draw) that performs an operation on a variety of data structures (classes). A selector describes what operation to perform. In C++ terminology: a (pure) virtual function.

the concrete definition that performs the operation described by the selector for a specific class. A method specifies how the operation is performed for a specific class.

selector invocation
a call of a selector. One argument of the call (the TOS (top-of-stack)) is used for determining which method is used. In Smalltalk terminology: a message (consisting of the selector and the other arguments) is sent to the object.

receiving object
the object used for determining the method executed by a selector invocation. In the `objects.fs' model, it is the object that is on the TOS when the selector is invoked. (Receiving comes from the Smalltalk message terminology.)

child class
a class that has (inherits) all properties (instance variables, selectors, methods) from a parent class. In Smalltalk terminology: The subclass inherits from the superclass. In C++ terminology: The derived class inherits from the base class.

  webmaster     delorie software   privacy  
  Copyright 2003   by The Free Software Foundation     Updated Jun 2003