代理类: 代理类的作用其实有继承有些类似,如果你想将某个实例的属性访问代理到内部另外一个实例中去,可以用继承也可以用代理.来看下代理的应用: class A: def spam(self,x): print 'in Class A x=%d' % x def foo(self): print 'in Class A:foo()' class B1: def __init__(self): self._a=A()
看Fresco的代码中,有这样的一个类: /** * To eliminate the possibility of some of our objects causing an OutOfMemoryError when they are * not used, we reference them via SoftReferences. * What is a SoftReference? * <a href="http://developer.android.com/reference