01.
翻译TIPatterns--灵活的结构(Flexible structure)灵活的结构(Flexible structure)组合Composite 关于Composite 模式,很重要的一点是,所有属于部分-整体(part-whole)的这些元素都是可以被操作的,也就是说对某个节点(node)/组合(composite)的操作也同样会作用于...查看完整版>>
翻译TIPatterns--灵活的结构(Flexible structure)
02.
Driver Code Structure (驱动结构)--翻译Most Windows CE–based device drivers use a layered approach. The advantage of this approach is that you only need to modify the upper or the lower layer. The upper layer is also known as the mod...查看完整版>>
Driver Code Structure (驱动结构)--翻译
03.
翻译TIPatterns--多个编程语言(Multiple languages)-2多个编程语言Multiple languages-2创造一门语言 使用Jython,在你的程序内部创造一种解释(interpreted)语言是极其简单的。考虑 《Thinking in Java》第二版第八章greenhouse控制器的那个例子。那种情形...查看完整版>>
翻译TIPatterns--多个编程语言(Multiple languages)-2
04.
翻译TIPatterns--多个编程语言(Multiple languages)-1多个编程语言Multiple languages-1 本章我们讨论跨越语言边界所带来的好处。通常来说,对于某个问题的解决,使用多于一种的编程语言比死抱住一门语言不放,会更便利。本章你将会看到,对于某种语言而言非常困...查看完整版>>
翻译TIPatterns--多个编程语言(Multiple languages)-1
05.
翻译TIPatterns--算法分解(Algorithmic partitioning)算法分解(Algorithmic partitioning) 命令模式(Command):运行时刻选择操作 在《Advanced C++: Programming Styles And Idioms》 (Addison-Wesley, 1992) 一书中,Jim Copline借用了functor这个术语,用以指代那些...查看完整版>>
翻译TIPatterns--算法分解(Algorithmic partitioning)
06.
翻译TIPatterns--连接不同类型(Connecting different types)连接不同类型(Connecting different types)适配器(Adapter) 适配器(Adaper)接受一种类型,并为其它类型产生一个接口。当你手头有某个类,而你需要的却是另外一个类(When you’ve got this, and you nee...查看完整版>>
翻译TIPatterns--连接不同类型(Connecting different types)
07.
翻译TIPatterns--太多(Too many)太多(Too many)享元(Flyweight):太多对象(too many objects) Flyweidht模式可能让人感到奇怪的一点是, 它(在其它模式的辅助下)是改善性能(performance hack)的一种方法。 通常来说比较好的做法就是简单的把系...查看完整版>>
翻译TIPatterns--太多(Too many)
08.
翻译TIPatterns--特化创建(Specialized creation)特化创建(Specialized creation)原型模式(Prototype) 通过克隆某个原型的实例来创建对象。“模式重构(Pattern Refactoring)”一章会给出这种模式的一个例子。生成器模式(Builder) Builder模式的目的...查看完整版>>
翻译TIPatterns--特化创建(Specialized creation)
09.
翻译TIPatterns--封装创建(Encapsulating creation)封装创建(Encapsulating creation) 当你发现需要向某个系统添加一些新类型的时候,最明智的做法就是先利用多态(polymorphism)为这些新类型创建一个公共接口。这可以使系统其余部分的代码与新加入的那些特定类型...查看完整版>>
翻译TIPatterns--封装创建(Encapsulating creation)
10.
翻译TIPatterns--对象去耦(Object decoupling)对象去耦(Object decoupling) 代理(Proxy)模式和状态(State)模式分别提供了供你使用的代理类(surrogate class);正真干活的那个类被代理类隐藏了。当你调用代理类的一个方法的时候,代理类只是简单的调用实...查看完整版>>
翻译TIPatterns--对象去耦(Object decoupling)
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。