Strategy Pattern
2014-10-13 03:15:30 4 举报
Strategy Pattern
作者其他创作
大纲/内容
RedDuck
- flyBehaviour:FlyBehaviour- quackBehaviour:QuackBehaviour
+ swim():void+ display():void
FlyYes
+ fly():void
MallardDuck
QuackNo
+ quack():void
RubberDuck
FlyBehaviour
QuackYes
FlyNo
Duck(abstract class)
- arg1:FlyBehaviour- arg2:QuackBehaviour
+ swim():void+ display():abstract void
QuackBehaviour
0 条评论
下一页