How Objects Interact

The actions defined by an object are its only interface to other objects. Actions form a kind of "wall" that encapsulates the object, and shields its internal information from outside objects. This shielding is called information hiding. Information hiding protects an object's data from corruption by outside objects, and also protects outside objects from relying on another object's private data, which can change without warning.

One object can act upon another (or cause it to act) only by calling that object's actions. Actions are invoked by sending messages. Objects respond to these messages by invoking methods ( Methods ) that perform an action, return data, or both. A message to an object must specify:

So the message format looks like this:


Assume that the object is the string !iH. Sending it a message to use its REVERSE action:


returns the string object Hi!.