Ruoyu111 / SimUDuck

Head First Design Patterns - Chapter 1 - The Strategy Pattern

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SimUDuck

Head First Design Patterns - Chapter 1 - The Strategy Pattern

The Strategy Pattern defines a family of algorithms, encapsulates each one, and makes them interchangeable. Strategy lets the algorithm vary independently from clients that use it.

OO Principles

  • Identify the aspects of your application that vary and separate them from what stays the same
    • Encapsulate what varies
  • Favor composition over inheritence (HAS-A can be better than IS-A)
  • Program to interfaces, not implementations

OO Basics

  • Abstraction
  • Encapsulation
  • Polymorphism
  • Inheritance

About

Head First Design Patterns - Chapter 1 - The Strategy Pattern


Languages

Language:Java 100.0%