设计模式看了又忘,忘了又看?

2019-05-27
阅读 2 分钟
1.3k
文章首发:设计模式看了又忘,忘了又看? 设计模式收藏这篇就够了 耗时了 5 个月,终于把设计模式一整个系列写完。其实设计模式这一系列文章网上已经有很多非常好、非常优秀的文章,为什么要写呢? 一方面是为了学得更扎实,印象中设计模式学习了 2 遍,记得牢的基本就那几个众所周知的,反思前面 2 次学习过程,缺少了...

结构型模式:代理模式

2019-05-15
阅读 3 分钟
1.3k
文章首发:结构型模式:代理模式 七大结构型模式之七:代理模式。 简介 姓名 :代理模式 英文名 :Proxy Pattern 价值观 :为生活加点料 个人介绍 :Provide a surrogate or placeholder for another object to control access to it.为其他对象提供一种代理以控制对这个对象的访问。(来自《设计模式之禅》) 你要的故...

结构型模式:享元模式

2019-05-07
阅读 3 分钟
1.1k
文章首发:结构型模式:享元模式 七大结构型模式之六:享元模式。 简介 姓名 :享元模式 英文名 :Flyweight Pattern 价值观 :共享富贵 个人介绍 :Use sharing to support large numbers of fine-grained objects efficiently.使用共享对象可有效地支持大量的细粒度的对象。(来自《设计模式之禅》) 你要的故事 还记...

结构型模式:外观模式

2019-05-05
阅读 3 分钟
1.2k
文章首发:结构型模式:外观模式 七大结构型模式之五:外观模式。 简介 姓名 :外观模式 英文名 :Facade Pattern 价值观 :统一口径、一致对外 个人介绍 :Provide a unified interface to a set of interfaces in a subsystem. Facade defines a higher-level interface that makes the subsystem easier to use.要求...

结构型模式:装饰模式

2019-04-29
阅读 3 分钟
1.1k
文章首发:结构型模式:装饰模式 七大结构型模式之四:装饰模式。 简介 姓名 :装饰模式 英文名 :Decorator Pattern 价值观 :人靠衣装,类靠装饰 个人介绍 :Attach additional responsibilities to an object dynamically keeping the same interface. Decorators provide a flexible alternative to subclassing for...

结构型模式:组合模式

2019-04-24
阅读 7 分钟
1.5k
文章首发:结构型模式:组合模式 七大结构型模式之三:组合模式。 简介 姓名 :组合模式 英文名 :Composite Pattern 价值观 :专门解决各种树形疑难杂症 个人介绍 :Compose objects into tree structures to represent part-whole hierarchies.Composite lets clients treat individual objects and compositions of o...

结构型模式:桥接模式

2019-04-22
阅读 3 分钟
1.6k
文章首发:结构型模式:桥接模式 七大结构型模式之二:桥接模式。 简介 姓名 :桥接模式 英文名 :Bridge Pattern 价值观 :解耦靠我 个人介绍 :Decouple an abstraction from its implementation so that the two can vary independently.将抽象和实现解耦,使得两者可以独立地变化。(来自《设计模式之禅》) 你要的...

结构型模式:适配器模式

2019-04-17
阅读 2 分钟
1.6k
文章首发:结构型模式:适配器模式 七大结构型模式之一:适配器模式。 简介 姓名 :适配器模式 英文名 :Adapter Pattern 价值观 :老媒人,牵线搭桥 个人介绍 :Convert the interface of a class into another interface clients expect.Adapter lets classes work together that couldn't otherwise because of incom...

行为型模式:访问者模式

2019-04-16
阅读 4 分钟
1.3k
姓名 :访问者模式英文名 :Visitor Pattern价值观 :来访者便是客,招待就是个人介绍 :Represent an operation to be performed on the elements of an object structure. Visitor lets you define a new operation without changing the classes of the elements on which it operates.封装一些作用于某种数据结构中...

行为型模式:解释器模式

2019-04-15
阅读 10 分钟
1.3k
姓名 :解释器模式英文名 :Interpreter Pattern价值观 :不懂解释到你懂​个人介绍 :Given a language, define a representation for its grammar along with an interpreter that uses the representation to interpret sentences in the language.给定一门语言,定义它的文法的一种表示,并定义一个解释器,该解释器...

行为型模式:备忘录模式

2019-03-27
阅读 5 分钟
1.1k
姓名 :备忘录模式英文名 :Memento Pattern价值观 :凡事要有备份个人介绍 :Without violating encapsulation,capture and externalize an object's internal state so that the object can be restored to this state later.在不破坏封装性的前提下,捕获一个对象的内部状态,并在该对象之外保存这个状态。这样以后就...

行为型模式:状态模式

2019-03-14
阅读 5 分钟
1.5k
姓名 :状态模式英文名 :State Pattern价值观 :有啥事让状态我来维护个人介绍 :Allow an object to alter its behavior when its internal state changes.The object will appear to change its class.当一个对象内在状态改变时允许其改变行为,这个对象看起来像改变了其类。(来自《设计模式之禅》)

行为型模式:观察者模式

2019-03-11
阅读 5 分钟
1.5k
姓名 :观察者模式英文名 :Observer Pattern价值观 :盯着你怎么着个人介绍 :Define a one-to-many dependency between objects so that when one object changes state,all its dependents are notified and updated automatically.定义对象间一种一对多的依赖关系,使得每当一个对象改变状态,则所有依赖于它的对象...

行为型模式:迭代器模式

2019-02-28
阅读 5 分钟
1.6k
LieBrother原文:行为型模式:迭代器模式 十一大行为型模式之六:迭代器模式。 简介 姓名 :迭代器模式 英文名 :Iterator Pattern 价值观 :人生没有回头路 个人介绍 : Provide a way to access the elements of an aggregate object sequentially without exposing its underlying representation.它提供一种方法访问...

行为型模式:策略模式

2019-02-26
阅读 5 分钟
1.6k
LieBrother原文:行为型模式:策略模式 十一大行为型模式之五:策略模式。 简介 姓名 :策略模式 英文名 :Strategy Pattern 价值观 :集计谋于一身 个人介绍 :Define a family of algorithms,encapsulate each one,and make them interchangeable.定义一组算法,将每个算法都封装起来,并且使它们之间可以互换。(来自...

行为型模式:责任链模式

2019-02-25
阅读 5 分钟
1.2k
LieBrother原文:行为型模式:责任链模式 十一大行为型模式之四:责任链模式。 简介 姓名 :责任链模式 英文名 :Chain of Responsibility Pattern 价值观 :责任归我 个人介绍 :Avoid coupling the sender of a request to its receiver by giving more than one object a chance to handle the request.Chain the rec...

行为型模式:命令模式

2019-02-22
阅读 5 分钟
1.6k
LieBrother原文:行为型模式:命令模式 十一大行为型模式之三:命令模式。 简介 姓名 :命令模式 英文名 :Command Pattern 价值观 :军令如山 个人介绍 : Encapsulate a request as an object,thereby letting you parameterize clients with different requests,queue or log requests,and support undoable operatio...

行为型模式:中介者模式

2019-02-18
阅读 4 分钟
1.4k
LieBrother公众号原文:行为型模式:中介者模式 十一大行为型模式之二:中介者模式。 简介 姓名 :中介者模式 英文名 :Mediator Pattern 价值观 :让你体验中介是无所不能的存在 个人介绍 : Define an object that encapsulates how a set of objects interact.Mediator promotes loose coupling by keeping objects f...

行为型模式:模板方法

2019-02-17
阅读 3 分钟
1.3k
LieBrother公众号原文:行为型模式:模板方法 十一大行为型模式之一:模板方法。 简介 姓名 :模板方法 英文名 :Template Method Pattern 价值观 :在我的掌控下,任由你发挥 个人介绍 : Define the skeleton of an algorithm in an operation,deferring some steps to subclasses. Template Method lets subclasses r...

创建型模式:原型模式

2019-01-27
阅读 5 分钟
1.7k
个人公众号原文:创建型模式:原型模式 五大创建型模式之五:原型模式。 简介 姓名 :原型模式 英文名 :Prototype Pattern 价值观 :效率第一 个人介绍 : Specify the kinds of objects to create using a prototypical instance,and create new objects by copying this prototype.用原型实例指定创建对象的种类,并...

创建型模式:建造者模式

2019-01-26
阅读 5 分钟
1.9k
个人公众号原文:创建型模式:建造者模式 五大创建型模式之四:建造者模式。 简介 姓名 :建造者模式 英文名 :Builder Pattern 价值观 :专治丢三落四 个人介绍 : Separate the construction of a complex object from its representation so that the same construction process can create different representation...

创建型模式:抽象工厂

2019-01-20
阅读 4 分钟
1.4k
个人博客原文:创建型模式:抽象工厂 五大创建型模式之三:抽象工厂。 简介 姓名 :抽象工厂 英文名 :Abstract Factory Pattern 价值观 :不管你有多少产品,给我就是了 个人介绍 : Provide an interface for creating families of related or dependent objects without specifying their concrete classes.为创建一...

创建型模式:工厂方法

2019-01-15
阅读 4 分钟
1.4k
个人博客原文创建型模式:工厂方法 简介 姓名:工厂方法 英文名:Factory method Pattern 价值观:扩展是我的专属 个人介绍: Define an interface for creating an object,but let subclasses decide which class to instantiate.Factory Method lets a class defer instantiation to subclasses. (定义一个用于创建对...

创建型模式:单例模式

2019-01-15
阅读 5 分钟
1.5k
个人博客原文:创建型模式:单例模式 简介 姓名:单例模式 英文名:Singleton Pattern 价值观:我的生活我主宰(只允许自己实例化,不愿意被其他对象实例化) 个人介绍: Ensure a class has only one instance, and provide a global point of access to it.(确保某一个类只有一个实例,而且自行实例化并向整个系统提...

开闭原则

2019-01-09
阅读 6 分钟
1.8k
个人博客原文:开闭原则 设计模式六大原则之六:开闭原则。 简介 姓名 :开闭原则 英文名 :Open Closed Principle 价值观 :老顽童就是我,休想改变我 个人介绍 : Software entities (classes, modules, functions, etc.) should be open for extension, but closed for modification.(软件中的对象(类,模块,函数...

迪米特法则

2019-01-05
阅读 3 分钟
4.5k
个人博客原文:迪米特法则 设计模式六大原则之五:迪米特法则。 简介 姓名:迪米特法则 英文名:Law of Demeter 小名:最少知识原则 小名英文名:Least Knowledge Principle 价值观:妈妈说不和陌生人说话 个人介绍: Each unit should have only limited knowledge about other units: only units "closely" related to ...

接口隔离原则

2019-01-04
阅读 5 分钟
1.5k
个人博客原文:接口隔离原则 设计模式六大原则之四:接口隔离原则。 简介 姓名 :接口隔离原则 英文名 :Interface Segregation Principle 价值观 :宁缺毋滥 个人介绍 : Clients should not be forced to depend upon interfaces that they don't use.(客户端不应该依赖它不需要的接口。) The dependency of one cla...

依赖倒置原则

2019-01-01
阅读 5 分钟
1.4k
个人博客原文:依赖倒置原则 设计模式六大原则之三:依赖倒置原则。 简介 姓名 :依赖倒置原则 英文名 :Dependence Inversion Principle 价值观 :大男子主义的典型代表,什么都得通过老大或者老爸同意 伴侣 :一定是个温柔体贴的女子 个人介绍 : High level modules should not depend upon low level modules.Both s...

里氏替换原则

2018-12-29
阅读 3 分钟
1.7k
个人博客原文:里氏替换原则 设计模式六大原则之二:里氏替换原则。 简介 姓名 :里氏替换原则 英文名 :Liskov Substitution Principle 座右铭 : If for each object o1 of type S there is an object o2 of type T such that for all programs P defined in terms of T,the behavior of P is unchanged when o1 is su...

单一职责原则

2018-12-26
阅读 4 分钟
1.4k
姓名 :单一职责原则英文名 :Single Responsibility Principle座右铭 :There should never be more than one reason for a class to change. 应当有且仅有一个原因引起类的变更。。。意思就是不管干啥,我都只干一件事,你叫我去买菜,我就只买菜,叫我顺便去倒垃圾就不干了,就这么拽脾气 :一个字“拽”,两个字“特拽“...