proxy pattern this is such good result that we want to create calculator object that does several mathematical series calculationsincluding calculating the fibonacci numbers see hereclass calculator(object)def fib_cached(selfncache)if return tryresult cache[nexceptcache[nfib_cached( cachefib_cached( cacheresult cache[nreturn result you know that most users of your object will not know what they should do with the cache variableor what it means having this variable in your method definition for the calculator method might cause confusion what you want instead is to have method definition that looks like the first piece of code we looked atbut with the performance benefits of caching in an ideal situationwe would have class that functions as an interface to the calculator class the client should not be aware of this classin that the client only codes toward the interface of the original classwith the proxy providing the same functionality and results as the original class the proxy pattern proxy provides the same interface as the original objectbut it controls access to the original object as part of this controlit can perform other tasks before and after the original object is accessed this is especially helpful when we want to implement something like memoization without placing any responsibility on the client to understand caching by shielding the client from the call to the fib methodthe proxy allows us to return the calculated result