观察者模式+迭代器模式+责任链模式+命令模式
2019-06-18 20:38:08 19 举报
观察者模式+迭代器模式+责任链模式+命令模式UML图
作者其他创作
大纲/内容
实现
ConcreteFilterA
- next:AbstractFilter
+ doFilter():void
命令模式
聚合
ConcreteFilterB
- chian:FilterChian
+ ConcreteFilterA(FilterChain)+ doFilter():void
责任器模式(通过NextFilter实现)
ConcreteObserverB
+ update(String):void
Client
+ main():void
继承
观察者模式
ConcreteReceiverB
+ action()
Invoker
- command:ICommand
+ setCommand(ICommand)+ call():void
依赖
ConcreteCommandA
- receiver:IReceiver=new ReceiverA()
+ execute():void
<<interface>>ISubject
+ registerObserver():void+ unregisterObserver():void+ notifyObserver():void
ConcreteIterator
- index:void
+ hasNext():boolean+ next():Object
<<interface>>IIterator
ConcreteContainer
- iterator:IIterator- reverseIterator:IIterator
+ getIterator():IIterator+ getReverseIterator():Iterator
<<abstract>>AbstractFilter
# next:AbstractFilter
+ final setNextFilter():void+ doFilter():void
ConcreteReceiverA
责任器模式(通过FilterChain实现)
<<interface>>IFilter
ICommand
<<interface>>IContainer
FilterChain
- filterList:List<IFilter>
+ addFilter(Filter):void+ doChian():void
迭代器模式
ConcreteObserverA
IReceiver
<<interface>>IObserver
ConcreteSubject
- observers:List<Observer>
ConcreteCommandB
- receiver:IReceiver=new ReceiverB()
关联
0 条评论
下一页