摘要: 单例模式分为两种,懒汉式和饿汉式。区别在于创建实例的时机。饿汉式在该类加载时创建实例,懒汉式则在需要获取时才进行创建。package Create.f.Singleton;public class Singleton { private Singleton(){ } protected stat... 阅读全文
posted @ 2016-01-02 21:32 ciade 阅读(227) 评论(0) 推荐(0) 编辑
摘要: package Create.d.Builder;//业务接口public interface Tax { void calcTax();} package Create.d.Builder;//业务接口public interface Salary { void calcSalary();} ... 阅读全文
posted @ 2016-01-02 21:20 ciade 阅读(209) 评论(0) 推荐(0) 编辑
摘要: package Create.c.AbstractFactory;//业务接口public interface Salary { void calcSalary();} package Create.c.AbstractFactory;//业务接口public interface Tax { vo... 阅读全文
posted @ 2016-01-02 21:12 ciade 阅读(219) 评论(0) 推荐(0) 编辑
摘要: package Create.b.FactoryMethod;//业务接口public interface Salary { void calcSalary();} package Create.b.FactoryMethod;//业务实现类public class HeBeiSalary imp... 阅读全文
posted @ 2016-01-02 20:30 ciade 阅读(188) 评论(0) 推荐(0) 编辑
摘要: package Create.a.SimpleFactory;//业务接口public interface Salary { void calcSalary();} package Create.a.SimpleFactory;//业务实现类public class HeBeiSalary imp... 阅读全文
posted @ 2016-01-02 20:25 ciade 阅读(156) 评论(0) 推荐(0) 编辑