|
|
Action on objects |
Ask not what the system does: Ask what it does it to! [Bertrand Meyer] | In an objected-oriented program, most actions - as carried out by operations (instance methods) -
happen on objects. |
| In non-object-oriented program, actions can happen without targeting an object.
In an object-oriented program, such action can be implemented by class methods. Class methods are known as static methods in C#. |
| We act on an object obj by sending messages, see here.
Either an outside object sends a message m to obj, or obj sends a message to itself.
When an object receives a message, a it will attempt to find an operation which can answer the message. In some languages, the process of locating the answering operation, is non-trivial. |