组合优于继承

# 组合优于继承

reference

摘自: "Design Patterns: Elements of Reusable Object-Oriented Software" 一书

  1. Program to an interface, not an implementation.(面向接口编程)

  2. Favor object composition over class inheritance.(尽量选择对象组合的设计方式)

# 参考资料