Coder Social home page Coder Social logo

wangxiaosheng / design-patterns Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jueee/design-patterns

0.0 0.0 0.0 2.13 MB

《设计模式:可复用面向对象软件的基础》学习笔记

Home Page: https://jueee.github.io/design-patterns/

C# 4.93% Java 94.79% HTML 0.28%

design-patterns's Introduction

设计模式

项目说明

本项目是《设计模式:可复用面向对象软件的基础》的学习笔记。

原书采用了 C++ 或 Smalltalk 语言进行代码示例,本项目统一采用 Java 提供丰富的样例。

目录

ch01.引言

  1. 什么是设计模式
  2. MVC中的设计模式
  3. 描述设计模式
  4. 设计模式的分类
  5. 设计模式的组织分类
  6. 设计模式解决设计问题的方式
  7. 怎样选择设计模式
  8. 怎样使用设计模式
  9. 相关词汇表

创建型模式抽象了实例化过程。它们帮助一个系统独立于如何创建、组合和表示它的那 些对象。

一个类创建型模式使用继承改变被实例化的类,而一个对象创建型模式将实例化委托给另一个对象。

  1. 抽象工厂-AbstractFactory
  2. 生成器-Builder
  3. 工厂方法-FactoryMethod
  4. 原型模式-Prototype
  5. 单例模式-Singleton
  6. 创建型模式的讨论

结构型模式涉及到如何组合类和对象以获得更大的结构。

结构型对象模式不是对接口和实现进行组合,而是描述了如何对一些对象进行组合,从而实现新功能的一些方法。

因为可以在运行时刻改变对象组合关系,所以对象组合方式具有更大的灵活性,而这种机制用静态类组合是不可能实现的。

  1. 适配器模式-Adapter
  2. 桥接模式-Bridge
  3. 组合模式-Composite
  4. 装饰模式-Decorator
  5. 外观模式-Facade
  6. 享元模式-Flyweight
  7. 代理模式-Proxy
  8. 结构型模式的讨论

行为模式涉及到算法和对象间职责的分配。

行为模式不仅描述对象或类的模式,还描述它们之间的通信模式。

这些模式刻划了在运行时难以跟踪的复杂的控制流。它们将你的注意力从控制流转移到对象间的联系方式上来。

  1. 责任链模式-ChainOfResponsibility
  2. 命令模式-Command
  3. 解释器模式-Interpreter
  4. 迭代器模式-Iterator
  5. 中介者模式-Mediator
  6. 备忘录模式-Memento
  7. 观察者模式-Observer
  8. 状态模式-State
  9. 策略模式-Strategy
  10. 模板方法模式-TemplateMethod
  11. 访问者模式-Visitor
  12. 行为模式的讨论

design-patterns's People

Contributors

jueee avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.