Continuing our investigation into unbounded APIs and AJAX overkill, in the previous recipe, we established that both should be avoided, but the solution to this was to make APIs change in case the APIs were not paginated. This assumes that you have access to these APIs or to someone who has. While this is a reasonable assumption to make, it will not hold true in all cases.
What can we do, besides not making requests (obviously), to preserve those poorly designed and out-of-control APIs? Well, an elegant way to resolve this problem would be to use the proxy pattern. The proxy pattern is used to control access to an object. You surely know that the web proxy can control access to web pages given a user's credentials. In this recipe, we will not talk about the web proxy, but the objected-oriented proxy. In the object-oriented proxy, we do not control so much...