Willvvvv’s Notes

记录与分享


  • 首页

  • 标签

  • 分类

  • 归档

访问者模式

发表于 2017-12-13 | 分类于 设计模式 | 阅读次数:
类图 代码Element 123456789101112131415161718192021222324252627abstract class Medicine{ private String name; private double price; public Med ...
阅读全文 »

状态模式

发表于 2017-12-13 | 分类于 设计模式 | 阅读次数:
类图 代码Context 123456789101112131415161718192021class Context { private State state; public Context(State state){ this.state=stat ...
阅读全文 »

备忘录模式

发表于 2017-12-11 | 分类于 设计模式 | 阅读次数:
类图 代码Mementor 12345678910111213141516171819202122232425class Mementor{ private Integer hp; private Integer mp; public Mementor(Integer h ...
阅读全文 »

命令模式

发表于 2017-12-07 | 分类于 设计模式 | 阅读次数:
类图 代码Command 1234interface Command{ void execute(); void undo();} Receiver 123456789101112131415161718class Receiver{ void act ...
阅读全文 »

责任链模式

发表于 2017-12-07 | 分类于 设计模式 | 阅读次数:
类图 代码Handler 1234567891011121314abstract class Handler{ private Handler next; Handler getNext() { return next; } voi ...
阅读全文 »

迭代器模式

发表于 2017-12-07 | 分类于 设计模式 | 阅读次数:
类图 代码1234interface Iterator{ Object next(); boolean hasNext();} 1234interface Aggregate{ void add(Object obj); Iterator ite ...
阅读全文 »

观察者模式

发表于 2017-12-06 | 分类于 设计模式 | 阅读次数:
类图 代码Observer 123interface Observer{ void update(String message);} Subject 123456789interface Subject{ void attach(Observer obser ...
阅读全文 »

模板方法模式

发表于 2017-12-06 | 分类于 设计模式 | 阅读次数:
类图 代码AbstractClass 12345678910111213abstract class Invoice{ public void start(){ System.out.println("开发票前操作"); boolean rs = ...
阅读全文 »

策略模式

发表于 2017-12-06 | 分类于 设计模式 | 阅读次数:
类图 代码Stragegy 123interface Vehicle{ String getName();} ConreteStrategy1 1234567class Car implements Vehicle{ @Override public ...
阅读全文 »

享元模式

发表于 2017-12-06 | 分类于 设计模式 | 阅读次数:
类图 代码Flywight 123456abstract class Flyweight{ abstract String getColor(); abstract void display(Coordinate coordinate);} ConcreteFlywe ...
阅读全文 »
1234
willvvvv

willvvvv

39 日志
2 分类
8 标签
© 2018 willvvvv
由 Hexo 强力驱动
|
主题 — NexT.Pisces v5.1.3