Reader small image

You're reading from  Kotlin Design Patterns and Best Practices - Third Edition

Product typeBook
Published inApr 2024
PublisherPackt
ISBN-139781805127765
Edition3rd Edition
Right arrow
Author (1)
Alexey Soshin
Alexey Soshin
author image
Alexey Soshin

Alexey Soshin is a software architect with 18 years of experience in the industry. He started exploring Kotlin when Kotlin was still in beta, and since then has been a big enthusiast of the language. He's a conference speaker, published writer, and the author of a video course titled Pragmatic System Design
Read more about Alexey Soshin

Right arrow

Proxy

Similar to the Decorator design pattern, the Proxy design pattern enhances an object’s capabilities. However, unlike a decorator that consistently follows instructions, a proxy might take a different route and behave differently when given a task.

In our earlier discussions about creational patterns in Chapter 2, where we explored working with such patterns, we already touched upon the concept of costly objects. These could be objects that rely on network resources or demand substantial time for creation.

Consider our scenario with the Funny Cat App, where we offer users daily doses of humorous cat images. On both our homepage and mobile app, users encounter an array of funny cat pictures. When they interact with these images, they’re presented in their full-screen glory.

The challenge lies in fetching these cat images from the network, a resource-intensive process, particularly if we’re dealing with images of cats that have a penchant for post...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Kotlin Design Patterns and Best Practices - Third Edition
Published in: Apr 2024Publisher: PacktISBN-13: 9781805127765

Author (1)

author image
Alexey Soshin

Alexey Soshin is a software architect with 18 years of experience in the industry. He started exploring Kotlin when Kotlin was still in beta, and since then has been a big enthusiast of the language. He's a conference speaker, published writer, and the author of a video course titled Pragmatic System Design
Read more about Alexey Soshin