Really Understanding Class Methods

Damien Cassou, St├ęphane Ducasse and Luc Fabresse

What You Will Learn

There is Only One Lookup

The lookup starts in the class of the receiver then:

Sending a Message

Sending a message is a two-step process:

  1. look up the method matching the message
  2. execute this method on the receiver

Sending a Message to a Class

Sending a message to Counter (a class)

  • go to the class of the class (Counter class)
  • follow the inheritance chain
  • apply the found method to the receiver: the class Counter

A Class is an Instance

A class is an instance of another class (called a metaclass)

Browsing two Classes

The browser can edit two classes: a class and its class

What You Should Know