What you do today can improve all your tomorrows.
Bear in mind: S = Single Responsibility Principle
O = Opened Closed Principle
L = Liskov Substitution Principle
I = Interface Segregation Principle
D = Dependency Inversion Principle
摘要:
依赖倒置主要体现的是“不是对具体类的依赖,而是对其抽象类/接口的依赖”,也可以说自己不去依赖具体实现,而是依赖抽象或接口,并由外部赋予具体实现。public abstract class 抽象类{}//低层类public class 具体类:抽象类{}//高层类public class 依赖类{ /... 阅读全文