經典的軟件開發哲學

DRY:Don’t Repeat Yourself -泛型設計

KISS:Keep it simple, stupid-簡單原則

Program to an interface, not an implementation-注重接口,而不是實現,依賴接口,而不是實現

Command-Query Separation (CQS)  – 命令-查詢分離原則

You Ain’t Gonna Need It (YAGNI) -避免過分設計原則

Law of Demeter – 迪米特法則,最少知識原則,解耦合原則

面向對象的S.O.L.I.D 原則:

Single Responsibility Principle (SRP) – 職責單一原則:一個類,只作一件事,並把這件事作好web

Open/Closed Principle (OCP) – 開閉原則:模塊對擴展是開放的,而對修改是封閉的shell

Liskov substitution principle (LSP) – 里氏替換原則:子類能替換基類ui

Interface Segregation Principle (ISP) – 接口隔離原則:功能實如今接口,不一樣功能不一樣接口彼此隔離spa

Dependency Inversion Principle (DIP) – 依賴倒置原則:高層模塊不該該依賴於低層模塊的實現,而是依賴於高層抽象。prototype

 

Common Closure Principle(CCP)– 共同封閉原則:把由於某個一樣的緣由而須要修改的全部類組合進一個包裏

Common Reuse Principle (CRP) – 共同重用原則:沒有被一塊兒重用的類不該該被組合在一塊兒。

Hollywood Principle – 好萊塢原則:全部的組件都是被動的,全部的組件初始化和調用都由容器負責。

High Cohesion & Low/Loose coupling & – 高內聚, 低耦合

Convention over Configuration(CoC)– 慣例優於配置原則

Separation of Concerns (SoC) – 關注點分離:將一個問題分解爲獨立且較小的問題

Design by Contract (DbC) – 契約式設計:子類前提條件不強於基類;後續條件不弱於基類.

Acyclic Dependencies Principle (ADP) – 無環依賴原則

 

UNIX的哲學:debug

  • Write programs that do one thing and do it well.設計

  • Write programs to work together.orm

  • Write programs to handle text streams, because that is a universal interface.對象

The Art of Unix Programming接口

  • Rule of Modularity: Write simple parts connected by clean interfaces.

  • Rule of Clarity: Clarity is better than cleverness.

  • Rule of Composition: Design programs to be connected to other programs.

  • Rule of Separation: Separate policy from mechanism; separate interfaces from engines.

  • Rule of Simplicity: Design for simplicity; add complexity only where you must.

  • Rule of Parsimony: Write a big program only when it is clear by demonstration that nothing else will do.

  • Rule of Transparency: Design for visibility to make inspection and debugging easier.

  • Rule of Robustness: Robustness is the child of transparency and simplicity.

  • Rule of Representation: Fold knowledge into data so program logic can be stupid and robust.

  • Rule of Least Surprise: In interface design, always do the least surprising thing.

  • Rule of Silence: When a program has nothing surprising to say, it should say nothing.

  • Rule of Repair: When you must fail, fail noisily and as soon as possible.

  • Rule of Economy: Programmer time is expensive; conserve it in preference to machine time.

  • Rule of Generation: Avoid hand-hacking; write programs to write programs when you can.

  • Rule of Optimization: Prototype before polishing. Get it working before you optimize it.

  • Rule of Diversity: Distrust all claims for 「one true way」.

  • Rule of Extensibility: Design for the future, because it will be here sooner than you think.

X Window的哲學:

  1. Small is beautiful.

  2. Make each program do one thing well.

  3. Build a prototype as soon as possible.

  4. Choose portability over efficiency.

  5. Store data in flat text files.

  6. Use software leverage to your advantage.

  7. Use shell scripts to increase leverage and portability.

  8. Avoid captive user interfaces.

  9. Make every program a filter.

相關文章
相關標籤/搜索