摘要:
package dmode.singleton;import java.util.Random;/** * 类描述: 单例模式 * 单例定义:ensure a class has only one instence,and provide a global point of access to i... 阅读全文
摘要:
一:单一职责原则(single Responsibility Principle) 接口尽量做到职责的单一性,类可以灵活设计,通过实现不同的接口来达到目的二:里氏替换原则 父类出现的地方,子类都可以出现。增强代码健壮性,版本升级时,即使增加子类,原有子类不受影响。每一个子类是一个业务实体,通过父... 阅读全文