C++ Design Pattern: What is a Design Pattern?
Q: What is a Design Pattern?
A: Design Patterns represent solutions to problems what arise when developing software within a particular context.
Each pattern describes a problem which occurs over and over again in
 our environment, and then describes the core of the solution to that
problem, in such a way that you can use this solution a million times
over, without ever doing it the same way twice.
C. Alexander, The Timeless Way of Building, 1979
Patterns help you learn from other's successes, instead of your own failures.
Mark Johnson (cited by Bruce Eckel)
Q: How many types of design patterns exist?
A: Basically, there are three categories:
- Creational Patterns: deal with initializing and configuring classes and objects
 - Structural Patterns: deal with decoupling the interface and implementation of classes and objects
 - Behavioral Patterns: deal with dynamic interactions among societies of classes and objects
 

Q: What are good books about design patterns.
A: Here are some must-have books:
- Design Patterns by Erich Gamma, Richard Helm, Ralph Johnson, John Vlissides (also known as Gang of Four)
 - Thinking in Patterns with Java, by Bruce Eckel
 - Thinking in Patterns with C++, by Bruce Eckel
 
Q: How can I quickly find information about a design pattern?
A: Here are some links on the web:
General
Creational Patterns
- Abstract Factory: Creates an instance of several families of classes
 - Builder: Separates object construction from its representation
 - Factory Method: Creates an instance of several derived classes
 - Prototype: A fully initialized instance to be copied or cloned
 - Singleton: A class of which only a single instance can exist
 
Structural Patterns
- Adapter: Match interfaces of different classes
 - Bridge: Separates an object’s interface from its implementation
 - Composite: A tree structure of simple and composite objects
 - Decorator: Add responsibilities to objects dynamically
 - Façade: A single class that represents an entire subsystem
 - Flyweight: A fine-grained instance used for efficient sharing
 - Proxy: An object representing another object
 
Behavioral Patterns
- Chain of Responsibility: A way of passing a request between a chain of objects
 - Command: Encapsulate a command request as an object
 - Interpreter: A way to include language elements in a program
 - Iterator: Sequentially access the elements of a collection
 - Mediator: Defines simplified communication between classes
 - Memento: Capture and restore an object's internal state
 - Observer: A way of notifying change to a number of classes
 - State: Alter an object's behavior when its state changes
 - Strategy: Encapsulates an algorithm inside a class
 - Template Method: Defer the exact steps of an algorithm to a subclass
 - Visitor: Defines a new operation to a class without change
 
and more resources on (www.oodesign.com). Make sure you read the design principles, it's very usefull for understanding the desing patterns:
OO Design Principles:
Open Close Principle
Dependency Inversion Principle
Interface Sergregation Principle
Single Responsibility Principle
Liskov's Substitution Principle
Creational Patterns:
Singleton
Factory
Factory Method
Abstract Factory
Builder
Prototype
Object Pool
Behavioral Patterns:
Chain of Responsibility
Command
Interpreter
Iterator
Strategy
Template Method
Visitor
C++ Design Pattern: What is a Design Pattern?的更多相关文章
- HTML:Registry design.(Include a simple web design use HTML)
		
Registry design: I feel a little bored when I design this registry,so T design a simple website all ...
 - 零元学Expression Design 4 - Chapter 2 熟悉Design并且快速设计出Silverlight网页
		
原文:零元学Expression Design 4 - Chapter 2 熟悉Design并且快速设计出Silverlight网页 本章将用带大家熟悉Design 4并制作简易的网页版面,也会让你了 ...
 - [Design Patterns] 03. Behavioral Patterns - Observer Pattern
		
前言 参考资源 Ref: 史上最全设计模式导学目录(完整版) 观察者模式-Observer Pattern[学习难度:★★★☆☆,使用频率:★★★★★] 对象间的联动——观察者模式(一):多人联机对战 ...
 - [Design Patterns] 02. Structural Patterns - Facade Pattern
		
前言 参考资源 史上最全设计模式导学目录(完整版) 只把常用的五星的掌握即可. 外观模式-Facade Pattern[学习难度:★☆☆☆☆,使用频率:★★★★★] 深入浅出外观模式(一):外观模式概 ...
 - Android Material Design:ViewPager与android.support.design.widget.TabLayout双向交互联动切换
		
通常,android.support.design.widget.TabLayout与Android的ViewPager联合使用,实现与ViewPager的切换与联动.(1)比如,当用户手指触摸选择T ...
 - 【译】UI设计基础(UI Design Basics)--为iOS设计(Design for iOS)(二)
		
2.1 为iOS设计(Design for iOS) iOS体现以下主题: 遵从:UI帮助用户理解界面内容并与内容交互,但绝不会与内容相互冲突. 清晰:文本在任何尺寸下都是清晰易读,图标精确易懂,装饰 ...
 - Material Design 开发利器:Android Design Support Library 介绍
		
转自:https://blog.leancloud.cn/3306/ Android 5.0 Lollipop 是迄今为止最重大的一次发布,很大程度上是因为 material design —— 这是 ...
 - Tcl与Design Compiler (十三)——Design Compliler中常用到的命令(示例)总结
		
本文如果有错,欢迎留言更正:此外,转载请标明出处 http://www.cnblogs.com/IClearner/ ,作者:IC_learner 本文将描述在Design Compliler中常用 ...
 - 【java设计模式】【创建模式Creational Pattern】建造模式Builder Pattern
		
package com.tn.pattern; public class Client { public static void main(String[] args) { Director dire ...
 
随机推荐
- FairyGUI和NGUI对比
			
一直在做Unity方面的游戏开发,经同事介绍了解到有这么一个GUI能提供跨平台的能力,有独立UI编辑器,而且功能强大,能够组合成复杂的UI界面,可以导出到Unity,Flash,Starling等,文 ...
 - mysqldump如何针对某些数据库进行备份?针对某个数据库进行备份?
			
需求描述: 通过mysqldump工具对mysql服务器中的某几个数据库进行备份. 或者就对其中的一个数据库进行备份. 操作过程: 1.通过--databases参数后面加上数据库的名字进行备份 [m ...
 - 理解ros话题--6
			
理解ROS话题(原创博文,转载请标明出处--周学伟http://www.cnblogs.com/zxouxuewei/) Description: 本教程介绍ROS话题(topics)以及如何使用ro ...
 - NHibernate初学四之关联一对一关系
			
1:数据库脚本,创建两张表T_Area.T_Unit,表示一个单位对应一个地区,在单位表中有个AreaID为T_Area表中的ID: CREATE TABLE [dbo].[T_Area]( [ID] ...
 - C语言函数參数传递原理
			
C语言中參数的传递方式一般存在两种方式:一种是通过栈的形式传递.还有一种是通过寄存器的方式传递的. 这次.我们仅仅是具体描写叙述一下第一种參数传递方式,第二种方式在这里不做具体介绍. 首先,我们看一下 ...
 - 超全面的JavaWeb笔记day11<JSP&Session&Cookie&HttpSession>
			
1.JSP 2.回话跟踪技术 3.Cookie 4.HttpSession JSP入门 1 JSP概述 1.1 什么是JSP JSP(Java Server Pages)是JavaWeb服务器端的动态 ...
 - VS-Qt-OSG-CMake基本项目框架
			
在VS-Qt-CMake基础上,打开mainwindow.ui,添加一个QWidget,然后在widget上右键-提升,选择SceneViewWidget CMakeLists.txt中添加了OSG相 ...
 - C语言100个经典的算法之兔子总数计算内含printf的用法
			
语言的学习基础,100个经典的算法 C语言的学习要从基础开始,这里是100个经典的算法-1C语言的学习要从基础开始,这里是100个经典的算法 题目:古典问题:有一对兔子,从出生后第3个月起每个月都生一 ...
 - 使用类/结构体时关于ZeroMomery用法错误
			
今天同事在写了如下结构体: typedef struct _tagInfo { std::list<int> lst; std::vector<int> nVec; } INF ...
 - OpenStack三个节点icehouse
			
一.环境准备 1.架构 创建3台虚拟机,分别作为controll节点.network节点和compute1节点. Controller节点:1processor,2G memory,5G storag ...