09 2017 档案
静态工厂方法+服务提供者框架模板
摘要:Provider.java Service.java Services.java Test.java 阅读全文
posted @ 2017-09-07 17:56 力奋 阅读(277) 评论(0) 推荐(0)
单元素枚举类型singleton模块
摘要:public enum Elvis { INSTANCE; public void leaveTheBuilding() { System.out.println("Whoa baby, I'm outta here!"); } // This code would normally appear outside the class! public static void ma... 阅读全文
posted @ 2017-09-07 17:48 力奋 阅读(286) 评论(0) 推荐(0)
私有构造器不可实例化类模板
摘要:public class UtilityClass { // Suppress default constructor for noninstantiability private UtilityClass() { throw new AssertionError(); } } 阅读全文
posted @ 2017-09-07 17:19 力奋 阅读(245) 评论(0) 推荐(0)
事件通知模板
摘要:事件通知与观察者模式类似,参照《Java软件体系结构设计模式标准指南》P258,代码https://github.com/birdstudiocn/design-patterns-example/tree/master/src/38 事件接口 事件容器类 事件注册类 事件目标实现类,Observab 阅读全文
posted @ 2017-09-05 10:55 力奋 阅读(529) 评论(0) 推荐(0)
JAVA代码模板总结
摘要:静态工厂方法+服务提供者框架模板 构造器模板 事件通知模板 单元素枚举类型singleton模块 私有构造器不可实例化类模板 构造器模板 事件通知模板 单元素枚举类型singleton模块 阅读全文
posted @ 2017-09-05 10:53 力奋 阅读(758) 评论(0) 推荐(0)