
设计模式
LoverJuan
这个作者很懒,什么都没留下…
展开
-
简单工厂模式
Shape.java package example1; public interface Shape { public void draw(); public void erase(); } Circle.java package example1; public class Circle implements Shape { @Override public void...原创 2018-10-19 12:08:48 · 197 阅读 · 0 评论 -
工厂方法模式
Log.java package example2; public interface Log { public void writeLog(); } FileLog.java package example2; public class FileLog implements Log { @Override public void writeLog() { System....原创 2018-10-19 12:14:27 · 215 阅读 · 0 评论 -
抽象工厂模式
Connection.java package example3; public interface Connection { public void connect(); } OracleConnection.java package example3; public class OracleConnection implements Connection { @Overri...原创 2018-10-19 12:21:23 · 216 阅读 · 0 评论