
CLASS DEFINITION = INTERFACE + IMPLEMENTATION
----------------------------------------------

- a typical class creation is divided into an interface and an implementation

  - an interface is the class definition-declaration, that's what the object
    is and does
  - an implementation is the class internal programmation, how its actions
    are implemented

- a message that can be sent to an object is stored in the runtime under
  the form of a selector. A selector is a kind of a signature of a message.

  eg. the message "addSelection: aSelection atIndex: anIndex"
      will have the selector "addSelection:atIndex:" 
            and the args     {aSelection anIndex}

- in myObjectiveTcl, a typical interface is like the following:

    for a class called 'myObject' which has:
      - 'Object' for parent class
      - 'name' and 'childs' for instance variable
      - 'initWithName:' and 'sayHello' for instance selectors
      - 'newWithName:' for class selector

    @interface myObject : Object  {
      {
        name childs
      }
      + newWithName: aName ;
      - initWithName: aName ;
      - sayHello ;
    }

- in myObjectiveTcl, a typical implementation is like the following:

    for the class called 'myObject', you'll write:

    @implementation myObject {
      + newWithName: aName {
          return [[$self new] initWithName: $aName]        
        }
      - initWithName: aName {
          $super init
          set name $Name 
          return $self
        }
      - init {} {
          return [$self initWithName: ""]
        }
      - sayHello {} {
          puts stderr "Hello"
          return $self
        }
    }

CATEGORY
---------

If you want to add functionnalities to an existing class without changing
 the original one and without creating a new subclass, you can do it
  with a category.

NB: you cannot add instance or class variables to the original class, only
    methods.
    this will change the behaviour for all future instances.

eg. 
    @interface myObject (add-on-by-Fred) {
      - sayGoodbye ;
    }
    @implementation myObject (add-on-by-Fred) {
      - sayGoodbye {} {
          puts stderr "Bye"
        }
    }

PROTOCOL
---------

If an Object is conform to a certain protocol, it means that it 
 implements all the methods defined in this protocol.

A protocol is only a kind of interface that declare methods to be implemented.

eg.

  @protocol Reader {
    - read: aFile ;
  }
  @protocol Writer {
    - write: aFile ;
  }

  NB: an object conform to the Reader protocol will respond to the "read: aFile"
      message (and must implement it of course). 

PROTOCOL INHERITENCE
--------------------

  @protocol ReaderWriter <Reader, Writer> {
    - openRW: aFile ;
  }

  NB: an object conform to the ReaderWriter protocol will 
     responds to messages "read: aFile", "write: aFile" and "openRW: aFile"

