99 Bottles of OOP

  • Chapter 1: How to decide if code is “good enough”. Solution: Shameless Green.
  • Chapter 2: TDD - What to test
  • Chapter 3: Where to start changing code. Open/Closed Principles + Code smells + Flocking Rules - refactoring code
  • Chapter 4: Liskov Substitution Principles in refactoring code.
  • Chapter 5: Which should trigger the creation of a new class.
  • Chapter 6: Refactor, but not only removes the conditions, but also allows you to implement the new six-pack requirement
  • Chapter 7: Tradeoffs along a continuum of six different styles of Factories
  • Chapter 8: new requirement …
  • Chapter 9: Full circle and returns to testing.

Basic promise of Object-Oriented Design (OOD): that if you’re willing to accept increases in the complexity of your code along some dimensions, you’ll be rewarded with decreases in complexity along others. OOD doesn’t claim to be free; it merely asserts that its benefits outweigh its costs.

Each of these design choices has costs, and it only makes sense to pay these costs if you also accrue some offsetting benefits. Design is thus about picking the right abstractions.

Chapter 1

1.1 Simplifying Code

  • Code must remain concrete enough to be understood while simultaneously being abstract enough to allow for change.