1995年,Erich Gamma萌衬、Richard Helm饮醇、Ralph Johnson 和 John Vlissides 四人合著出版了《Design Patterns: Elements of Reusable Object-Oriented Software》,將設(shè)計(jì)模式引入軟件工程領(lǐng)域秕豫。這四位作者被稱為 Gang of Four朴艰,因此這本書(shū)也被稱為 GoF。
設(shè)計(jì)模式屬于軟件開(kāi)發(fā)的基礎(chǔ)知識(shí)混移,在 GoF 一書(shū)中列舉了 23 種設(shè)計(jì)模式祠墅,分類為創(chuàng)建型模式、結(jié)構(gòu)型模式以及行為模式歌径。本系列文章借助 Java 語(yǔ)言對(duì)現(xiàn)有的設(shè)計(jì)模式進(jìn)行說(shuō)明和演示毁嗦。
創(chuàng)建型模式
抽象工廠(Abstract Factory)
生成器(Builder)
原型(Prototype)
結(jié)構(gòu)型模式
適配器(Adapter)
橋接(Bridge)
組合(Composite)
裝飾者(Decorator)
外觀(Facade)
享元(Flyweight)
代理(Proxy)
行為模式
責(zé)任鏈(Chain of Responsibility)
命令(Command)
解釋器(Interpreter)
迭代器(Iterator)
中介者(Mediator)
備忘錄(Memento)
觀察者(Observer)
狀態(tài)(State)
策略(Strategy)
模板方法(Template Method)
訪問(wèn)者(Visitor)