Sitemap
Gokhan Mutlu

Gokhan Mutlu

iOS/Software Developer

1 min readNov 23, 2024

Thank you for your informative Story. I enjoyed reading it. If you dont mind, I'd like to implement/share my sample Prototype pattern code snippet based on your example.

In my version, when I create a user profile, I need to check if it was created before. Following "Service" class is responsible for that task. Unfortunately it takes us three seconds due to slow internet connection in Turkiye...

"copy" method creates a template object and makes a shallow-copy, otherwise, if we use overloaded initializer, we need to wait 3 more seconds for each and every new cloned object.

Now, we don't suffer from substantial amount of memory use or heavy computations in order to prepare the object. This is the beautify of prototyping.

Thank you again for your Story.

--

--