摘要:
命令模式:将请求封装成对象,这可以让你使用不同的请求,队列,或者日志请求来参数化其他对象。命令模式也可以支持撤销操作。——《HEAD FIRST 设计模式》 我的golang代码: package command import ( "fmt"
) const slotnums = 7 type Command interface { execute()
} //... 阅读全文
阅读排行榜
外观模式
2015-04-29 00:14 by foolbread-老陈, 128 阅读, 收藏,
摘要:
外观模式:提供了一个统一的接口,用来访问子系统中的一群接口。外观定义了一个高层接口,让子系统更容易使用。——《HEAD FIRST 设计模式》 我的c++代码: #ifndef DESIGN_FACADE_H_
#define DESIGN_FACADE_H_ namespace facade{ class PopcornPopper
{
public: void On()... 阅读全文
装饰者模式
2015-04-23 15:21 by foolbread-老陈, 125 阅读, 收藏,
摘要:
装饰者模式:动态地将责任附加到对象上。想要扩展功能,装饰者提供有别于继承的另一种选择。——《HEAD FIRST 设计模式》 我的golang代码: package decorator //////////////////////////////////
type Beverage interface { GetDescription() string Cost() in... 阅读全文
2014年4月网摘
2014-05-07 23:26 by foolbread-老陈, 123 阅读, 收藏,
摘要:
1、http://news.cnblogs.com/n/206583/有关百度云网盘一些实现技巧,还是不错,科普下一般网盘的实现。2、http://coolshell.cn/articles/11466.html有关C语言整形溢出的文章,文章很清晰。3、http://news.cnblogs.com... 阅读全文
浙公网安备 33010602011771号