
上QQ阅读APP看本书,新人免费读10天
设备和账号都新为新人
5.4 简单工厂模式在框架源码中的应用
5.4.1 简单工厂模式在JDK源码中的应用
简单工厂模式在JDK源码中无处不在,例如Calendar类,看Calendar.getInstance()方法。下面打开的是Calendar的具体创建类。


5.4.2 简单工厂模式在Logback源码中的应用
在大家经常使用的Logback中,可以看到LoggerFactory中有多个重载的方法getLogger()。

简单工厂模式在JDK源码中无处不在,例如Calendar类,看Calendar.getInstance()方法。下面打开的是Calendar的具体创建类。
在大家经常使用的Logback中,可以看到LoggerFactory中有多个重载的方法getLogger()。