proxy pattern the memoize function takes regular old function as parameterthen it records the result of calling the received function if needed it calls the function and receives the newly calculated values before returning new function with the result saved if that value should be needed in future the final result is seen herecalculating the list of fibonacci numbers took - seconds really like the fact that the memoize function can be used with any function passed to it having generic piece of code like this is helpfulas it allows you to memoize many different functions without altering the code this is one of the main aims of objectoriented programming as you gain experienceyou should also build up library of interesting and useful pieces of code you can reuse ideallyyou want to package these into your own libraries so you can do more in less time it also helps you to keep improving now that you understand the proxy patternlet' look at the different types of proxies available to us we already looked at cache proxy in detailso what remains are the followingremote proxy virtual proxy protection proxy remote proxy when we want to abstract the location of an objectwe can use remote proxy the remote object appears to be local resource to the client when you call method on the proxyit transfers the call to the remote object once the result is returnedthe proxy makes this result available to the local object virtual proxy sometimes objects may be expensive to createand they may not be needed until later in the program' execution when it is helpful to delay object creationa proxy can be used the target object can then be created only once it is needed