[ Team LiB ] Previous Section Next Section

Interlude 3. Design Patterns

I3.1. Patterns
  • Abstract Factory: Replace Constructor with Factory Method (several times)

  • Factory Method: Replace Constructor with Factory Method

  • Flyweight: Remove Setting Method, Change Value to Reference

  • Interpreter: Extract Method and Move Method (from Composite)

  • Observer: Separate Domain from Presentation, Duplicate Observed Data

  • State: Replace Type Code with State/Strategy

  • Strategy: Replace Type Code with State/Strategy

  • Template Method: Form Template Method

Joshua Kerievsky is working on a book about this subject called Refactoring to Patterns; perhaps it will be available by the time you read this.


    [ Team LiB ] Previous Section Next Section