Object Oriented Design

  • classes: How do you decide what a class is and what it is not?
  • classes and objects
  • instance variables
  • constructor (no destructor
  • methods: private/public
  • inheritence: rarely is this the best solution
  • composition and delegation: a better solution
  • Polymorphism
  • “Duck” typing.
    • Do you see how duck typing is an alternative/complement to inheritence?
    • Consider a method like #can_speak? in a gaming application
Reference