zoukankan      html  css  js  c++  java
  • 设计模式总结

    1. Adapter,适配器,

    Wraps an object and provides a different interface to it.

    适配一个对象,然后提供一个别的接口

    2. Template method

    Subclasses decide how to implement steps in an algorithm.

    子类决定怎么实现算法步骤

    3. 工厂方法 Factory Method
    Subclasses decide which concrete classes to create.

    子类决定创建哪个具体类的对象

    4.单例模式 Singleton
    Ensures one and only object is created.

    保证只有一个对象创建

    5. 策略模式
    Encapsulates interchangeable behaviors and uses delegation to decide which one to use.

    封装可变的行为,用一个委托去决定用哪个

    6. 组合模式Composite
    Clients treat collections of objects and individual objects uniformly.

    调用端用同一的方式对待一个对象和一组对象。

    7. 状态模式State
    Encapsulates state-based behaviors and uses delegation to switch between behaviors.

    包装跟状态有关的行为,并且根据状态切换。

    8. 迭代器模式 Iterator

    Provides a way to traverse a collection of objects without exposing its implementation.

    提供一个访问集合的方式,而不用了解他们具体的形式

    9. 外观模式Facade
    Simplifies the interface of a set of classes.

    为一对类提供一个简化接口

    10. 装饰者模式
    Wraps an object to provide new behavior.

    每次包装一个对象,提供新的行为。

    11. 抽象工厂
    Allows a client to create families of objects without specifying their concrete classes.

    创建一组相关的类,这组类息息相关。

    12. 观察者模式Observer
    Allows objects to be notified when state changes.

    每次状态改变,通知其他对象

    13.代理模式Porxy

    包装一个对象,控制对他的访问
    Wraps an object to control access to it.

    14. 命令模式,Command
    Encapsulates a request as an object

    封装调用,成一个对象。

  • 相关阅读:
    多进程编程
    Python 的下载安装
    cnBlogs windows LIves Writes 安装
    第四章网页文字编排设计
    第三章网页图形图像设计
    第二章网页创意设计思维和方法
    1.3-1.4网页设计的定位和流程
    1.2网页设计的构成要素和特性
    网页编辑常用快捷方式+学习技巧+网站开发流程
    css选择器2——伪类选择器
  • 原文地址:https://www.cnblogs.com/shenfengok/p/6887791.html
Copyright © 2011-2022 走看看