O'Reilly logo

Learning Python Design Patterns by Gennadiy Zlobin

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Summary

A proxy is a class, functioning as an interface to another class, which has the same interface as the proxy. The client code instantiates and works directly with the proxy, whereas, the proxy delegates actual work to a client class. Proxies have many uses, particularly for caching, reference count, and access-right control. Users of proxy should be careful to avoid an increase in response time. The Observer design pattern is used when you need to implement one-to-many relationships, for instance, to broadcast the same information to multiple listeners called observers. The Observer design pattern maintains loose coupling between the subject and observers because the only thing the subject knows about the observers is the interface, namely, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required