Proxy模式与Decorator模式的区别
看了一篇文章(http://www.javaworld.com/javaworld/jw-02-2002/jw-0222-designpatterns.html)说到:
两个模式比较相似,因为Both patterns use a proxy that forwards method calls to another object, known as the real subject.
两模式的不同之处在于:with the Proxy pattern, the relationship between a proxy and the real subject is typically set at compile time, whereas decorators can be recursively constructed at runtime。
不是很能理解上面所说的不同之处,请各位指教(最好可以举例说明)。谢谢。