摘要:
装饰模式(Decorator): 动态地将责任附加到对象上,若要扩展功能,装饰者提供了比继承更有弹性的替代方案。将被装饰者作为装饰者的属性传入,被装饰者会提供一些功能,但通常这些功能不太能满足需求,故须在装饰者内部再根据需要提供额外的功能,被装饰者提供的功能和装饰者提供的额外功能共同完成某种需求。同时,装饰者还可以被包装成为被装饰者,外层装饰者再根据其它需要提供额外功能。ps:继承可以静态地扩展功能,装饰模式则可以动态地扩展功能。装饰模式最典型的就是Java IO了:new UpperCaseConvertReader ( new BufferedReader( new... 阅读全文
posted @ 2012-04-27 21:14
ini_always
阅读(310)
评论(0)
推荐(0)
摘要:
最近爱折腾的毛病又犯了,开始折腾起Emacs,在自定义Emacs的配置文件存放位置时遇到一点问题,不过,在GNU的Emacs站点,看到这么一段话:On Windows, the .emacs file may be called _emacs for backward compatibility with DOS and FAT filesystems where filenames could not start with a dot. Some users prefer to continue using such a name, because Explorer cannot creat 阅读全文
posted @ 2012-04-27 00:13
ini_always
阅读(12470)
评论(0)
推荐(1)

浙公网安备 33010602011771号