Hack hack hack...

An open journal-- some of it written for you, but most of it is for me.

Gang of Four Chap 1

Polymorphism vs duck typing

### Polymorphism

- often hear in the context of subclasses

### Duck typing

- usually hear in the context of mixins
- an interface that can interact without having to know what that object is
  • class inheritance versus interface inheritance

Composition vs class inheritance

  • Rule of thumb: when behavior spans classes use composition and when limited to derivations of classes then use subclassing

Run time versus compile time

Program to an interface not an implementation

  • interface is the behavior