Glossary

SLAP

抽象層次一致性 (組合函數要求將一個大函數拆成多個子函數的組合,而SLAP要求函數體中的内容必須在同一個抽象層次上。)
Single Level of Abstraction Principle

SOLID
Design Principles and Design Patterns(2000)
Robert C. Martin

  • SRP
    單一職責原則(任何一個軟件模塊中,應該有且只有一個被修改的原因。)
    Single Responsibility Principle
  • OCP
    開閉原則(軟件實體應該對擴展開放,對修改關閉。)
    Open Close Principle
  • LSP
    裏氏替換原則(程序中的父類型都應該可以正確地被子類型替換。)
    Liskov Substitution Principle
  • ISP
    接口隔離原則(多個特定客戶端接口要好于一個寬汎用途的接口。)
    Interface Segregation Principle
  • DIP
    依賴倒置原則(模塊之間交互應該依賴抽象,而非實現。)
    Dependency Inversion Principle

DRY
《The Pragmatic Programmer》
Andy Hunt and Dave Thomas

Don't Repeat Yourself

YAGNI
《Extreme Programming Installed》
Ron Jeffries

You Ain't Gonna Need It

Rule of Three
《Refactoring: Improving the Design of Existing Code》重構
Martin Fowler

  • 第一次用到某個功能時,寫一個特定的解決方案。
  • 第二次有用到的時候,複製上一次的代碼。
  • 第三次出現的時候,才着手“抽象化”,寫出通用的解決方法。

KISS
BSC: Balance Scorecard平衡計分卡**
Robert S. Kaplan

Keep It Simple and Stupid

POLA

最小驚奇原則
Principle of least astonishment

posted @ 2020-10-24 22:13  Ying‘s  阅读(14)  评论(0编辑  收藏  举报