Intro Dependency Injection And Liskov 替換原則
Intro Dependency Injection And Liskov 替換原則
Intro Dependency Injection And Liskov 替換原則
Dependency Injection
針對interface程式設計,不要對implement程式設計。
高層模組不應該依賴低層模組,兩者都應該依賴抽象。
Liskov替換原則
子類別的可替換性才使得使用父類別的模組在無需修改的情況下
就可以擴展。