随笔分类 -  设计模式

摘要:一、定义 建造者模式(Builder Pattern)也叫生成器模式,其定义如下: Separate the construction fo a complex object from its representation so that the same comstruction process 阅读全文
posted @ 2016-12-19 15:54 飞轩 阅读(195) 评论(0) 推荐(0)
摘要:一、定义 模板方法模式(Template Method Pattern)的定义如下: Define the skeleton of an algorithm in an operation, deferring some steps to subclasses. Template Method le 阅读全文
posted @ 2016-12-19 13:54 飞轩 阅读(241) 评论(0) 推荐(0)
摘要:一、定义 抽象工厂模式(Abstract Factory Pattern)是一种比较常见的模式,其定义如下: Provide an interface for creating families of related or dependent objects without specifying t 阅读全文
posted @ 2016-12-19 11:28 飞轩 阅读(215) 评论(0) 推荐(0)
摘要:一、定义 Define an interface for creating an object, but let subclasses decide which class to instantiate. Factory Method lets a class defer instantiation 阅读全文
posted @ 2016-12-18 21:23 飞轩 阅读(241) 评论(0) 推荐(0)
摘要:一、定义 单例模式(Singleton Pattern)是一个比较简单的模式,定义如下: Ensure a class has only one instance, and provide a global point of access to it.(确保某一个类职业一个实例,而且自行实例化并向整 阅读全文
posted @ 2016-12-18 19:52 飞轩 阅读(214) 评论(0) 推荐(0)
摘要:一、单一职责原则 Single Responsibility Principle,简称SRP。 单一职责原则的定义是:应该有且仅有一个原因引起类的变更。 二、里氏替换原则 Liskov Substitution Principle,LSP 定义1:如果每一个类型为S的对象o1,都有类型为T的对象o2 阅读全文
posted @ 2016-12-18 17:46 飞轩 阅读(206) 评论(0) 推荐(0)