摘要:
单例模式分为两种,懒汉式和饿汉式。区别在于创建实例的时机。饿汉式在该类加载时创建实例,懒汉式则在需要获取时才进行创建。package Create.f.Singleton;public class Singleton { private Singleton(){ } protected stat... 阅读全文
摘要:
package Create.d.Builder;//业务接口public interface Tax { void calcTax();} package Create.d.Builder;//业务接口public interface Salary { void calcSalary();} ... 阅读全文
摘要:
package Create.c.AbstractFactory;//业务接口public interface Salary { void calcSalary();} package Create.c.AbstractFactory;//业务接口public interface Tax { vo... 阅读全文
摘要:
package Create.b.FactoryMethod;//业务接口public interface Salary { void calcSalary();} package Create.b.FactoryMethod;//业务实现类public class HeBeiSalary imp... 阅读全文
摘要:
package Create.a.SimpleFactory;//业务接口public interface Salary { void calcSalary();} package Create.a.SimpleFactory;//业务实现类public class HeBeiSalary imp... 阅读全文