23种经典设计模式UML类图汇总

首先要看得懂UML类图和时序图,不同符号表示相互间的关系含义。使用下图做一个简析的说明:

_images/uml_class_struct.jpg

  • 车的类图结构为<<abstract>>,表示车是一个抽象类;
  • 它有两个继承类:小汽车和自行车;它们之间的关系为实现关系,使用带空心箭头的虚线表示;
  • 小汽车为与SUV之间也是继承关系,它们之间的关系为泛化关系,使用带空心箭头的实线表示;
  • 小汽车与发动机之间是组合关系,使用带实心箭头的实线表示;
  • 学生与班级之间是聚合关系,使用带空心箭头的实线表示;
  • 学生与身份证之间为关联关系,使用一根实线表示;
  • 学生上学需要用到自行车,与自行车是一种依赖关系,使用带箭头的虚线表示

A pattern is a successful or efficient solution to a recurring  problem within a context
类型

模式名称

学习难度

使用频率

创建型模式

Creational Pattern

单例模式

Singleton Pattern

★☆☆☆☆

★★★★☆

简单工厂模式

Simple Factory Pattern

★★☆☆☆

★★★☆☆

工厂方法模式

Factory Method Pattern

★★☆☆☆

★★★★★

抽象工厂模式

Abstract  Factory Pattern

★★★★☆

★★★★★

原型模式

Prototype Pattern

★★★☆☆

★★★☆☆

建造者模式

Builder Pattern

★★★★☆

★★☆☆☆

结构型模式

Structural Pattern

适配器模式

Adapter Pattern

★★☆☆☆

★★★★☆

桥接模式

Bridge  Pattern

★★★☆☆

★★★☆☆

组合模式

Composite  Pattern

★★★☆☆

★★★★☆

装饰模式

Decorator  Pattern

★★★☆☆

★★★☆☆

外观模式

Façade  Pattern

★☆☆☆☆

★★★★★

享元模式

Flyweight  Pattern

★★★★☆

★☆☆☆☆

代理模式

Proxy  Pattern

★★★☆☆

★★★★☆

行为型模式

Behavioral Pattern

职责链模式

Chain  of Responsibility Pattern

★★★☆☆

★★☆☆☆

命令模式

Command  Pattern

★★★☆☆

★★★★☆

解释器模式

Interpreter  Pattern

★★★★★

★☆☆☆☆

迭代器模式

Iterator  Pattern

★★★☆☆

★★★★★

中介者模式

Mediator  Pattern

★★★☆☆

★★☆☆☆

备忘录模式

Memento  Pattern

★★☆☆☆

★★☆☆☆

观察者模式

Observer  Pattern

★★★☆☆

★★★★★

状态模式

State  Pattern

★★★☆☆

★★★☆☆

策略模式

Strategy  Pattern

★☆☆☆☆

★★★★☆

模板方法模式

Template  Method Pattern

★★☆☆☆

★★★☆☆

访问者模式

Visitor  Pattern

★★★★☆

★☆☆☆☆





评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值