Ruoyu111 / Starbuzz

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Starbuzz Coffee Shop

Head First Design Patterns - Chapter 3 - The Decorator Pattern

The Decorator Pattern Attach additional responsibilities to an object dynamically. Decorators provide a flexible alternative to subclassing for extending functionality.

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
  • Strive for loosely coupled designs between objects that intract
  • Classes should be open for extension but closed for modification

About


Languages

Language:Java 100.0%