
读design pattern笔记
javastd
专注于性能测试、自动化测试、安全测试
展开
-
如何区分class inheritance和interface inheritance
It's also important to understand the difference between class inheritance and interface inheritance (orsubtyping). Class inheritance defines an object's implementation in terms of another object's i...2007-06-16 14:40:56 · 239 阅读 · 0 评论 -
Programming to an Interface, not an Implementation
Class inheritance is basically just a mechanism for extending an application's functionality by reusingfunctionality in parent classes. It lets you define a new kind of object rapidly in terms of an ...2007-06-16 14:46:29 · 111 阅读 · 0 评论 -
config out difference between an object class and its type
It's important to understand the difference between an object's class and its type.An object's class defines how the object is implemented. The class defines the object's internal state and theimple...2007-06-16 14:57:25 · 97 阅读 · 0 评论 -
Favor object composition over class inheritance.
The two most common techniques for reusing functionality in object-oriented systems are class inheritanceand object composition. As we've explained, class inheritance lets you define the implementati...2007-06-16 15:04:09 · 151 阅读 · 0 评论 -
difference aggregation and association
Consider the distinction between object aggregation and acquaintance and how differently they manifestthemselves at compile- and run-times. Aggregation implies that one object owns or is responsible ...2007-06-16 15:26:44 · 101 阅读 · 0 评论 -
when to use pattern
Here are some common causes of redesign along with the design pattern(s) that address them:1. Creating an object by specifying a class explicitly. Specifying a class name when you create an objectco...2007-06-16 15:37:12 · 106 阅读 · 0 评论 -
Proxy模式与Decorator模式的区别
proxy模式和decorator模式都是处理两个类的关系,所不同的是两者关系在何时被建立,英文意思说:proxy模式是在编译时建立关系;而decorator模式则可以在运行时构建。 如果我没有理解错的话:老外视图从编译或运行两者语言状态来描述两者区别,我不敢苟同。 ...2007-06-22 09:47:20 · 224 阅读 · 0 评论