![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
设计者模式
张泽渊
这个作者很懒,什么都没留下…
展开
-
设计模式专题(上)创建者模式
设计模式专题 创建型模式 1.单例模式 保证一个类只有实例,并且提供一个访问该实例的全局访问点 饿汉式 static变量会在类装载时初始化,无并发; public class test { private static /*final*/test s=new test(); private test() {} public static /*synchronized*/ test ...原创 2019-08-27 08:57:40 · 484 阅读 · 0 评论 -
设计模式专题(中)结构型模式
设计模式专题 结构型模式 1.适配器adapter模式 结构 Target 适配器接口 interface Target { void handleReq(); } Adpater 适配器(ps/2和usb的转换器) public class Adapter (extends Adaptee) implements Target {//类适配器 // Adaptee ada...原创 2019-09-01 15:51:07 · 115 阅读 · 0 评论 -
设计模式专题(下)行为型模式
设计模式专题 行为型模式 1.责任链模式 chain of responsibility 2.迭代器模式 iterator 结构 游标 cursor next( ),hasNext( ),getCurrent( )等方法 3.中介者模式 Mediator 核心 将网状结构化解为星状结构 3.命令模式 command 4.解释器模式 Interpreter 用于描述如何构成一...原创 2019-09-05 21:40:20 · 124 阅读 · 0 评论