A Pattern is a solution to a problem in a context


command模式

http://www.tracefact.net/Design-Pattern/Command.aspx

 设计模式分类(结构型、创建型, 行为型)

http://www.cnblogs.com/justForMe/archive/2011/07/18/2109211.html


decorator  添加职责, 不改变接口

adaptor     接口适配转换, 改变接口

facade       使接口更简单(减少依赖的类)


facade模式与The Principle of Least Knowledge

The object itself
ß Objects passed in as a parameter to the method
ß Any object the method creates or instantiates
ß Any components of the object


总结设计模式有哪些原则? 

单一职责(例如迭代模式中,迭代这一功能分离开来,因为迭代可能有中间状态要维护)

only talk to friend

等等

总结这些原则有助于说明为什么要用这些模式(head first 一书中有讲解)



格式:

模式名:

类图:

设计原则:

好处:

坏处:

应用例子(代码?):


http://blog.csdn.net/wwj_748/article/details/9747941 有很好的总结(head first这本书)






评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值