Search⌘ K
AI Features

Proxy Design Pattern

Explore the Proxy design pattern in Kotlin to understand how it uses lazy delegation and caching to optimize resource loading and control access. Learn to implement virtual, remote, and protection proxies to create efficient and scalable software.

We'll cover the following...

Proxy design pattern

Much like the Decorator design pattern, the Proxy design pattern extends an object’s functionality. However, unlike a decorator, which always does what it’s told, having a proxy may mean that when asked to do something, the object does something totally different.

We’ve already touched on the idea of expensive objects. For example, an object that accesses network resources or takes a lot of time to create.

Let’s say we at the Funny Cat App provide our users with funny cat images on a daily basis. On our homepage and mobile application, each user sees a lot of pictures of funny cats. ...