![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
设计模式
文章平均质量分 80
winglessbird
这个作者很懒,什么都没留下…
展开
-
设计模式-Strategy代码+UML图
class Duck{ public: FlyBehavior* flyBehavior; QuackBehavior* quackBehavior; void performFly() { flyBehavior->fly(); } void performQuack() { quackBehavior->quack(); } }; class Mal原创 2016-01-29 17:58:18 · 282 阅读 · 0 评论 -
设计模式—Composite代码
public abstract class MenuComponent{ public void add(MenuComponent menuComponent) { } public void remove(MenuComponent menuComponent) { } public void getComponent getChild(int i) { }原创 2016-01-29 18:00:35 · 259 阅读 · 0 评论