责任链,模板,观察者模式类图
2016-05-23 14:57:53 75 举报
设计模式学习
作者其他创作
大纲/内容
Node
- node:Node
- filter(Requst req):void- add(Node node):Node- remove(Node node):void- hasNext():boolean- next():Chain
PlayerViewStategy
- canSee(ViewStategy target)
AreaMegicViewStategy
Request
...包含对应的过滤参数
Template1
- operation1():void- operation3():void
Subject
- attach(Observer observer):void - detach(Observer observer):void - notifyObservers():void
模板方法模式
VisibleObject
viewStrategy:ViewStategy
策略模式
Node1
- filter(Requst req):void
Observer1
- update():void
Observer
观察者模式
Node2
MonsterViewStategy
Template2
- operation2():void- operation3():void
ViewStategy
owner:VisibleObject
责任链模式
Template
- operationAll():void- operation1():void- operation2():void- operation3():void
Observer2
收藏
收藏
0 条评论
下一页