Kotlin Design Patterns: Simplifying the Prototype Pattern

We use the Prototype Pattern when creating new instances from scratch is more expensive than copying existing ones. So, instead of instantiating new objects, you can have a prototype from which clones/copies are made. Traditional approach in Java In this Java example, GraphicElement represents a complex graphic element with complex initialization logic, Read more

By Lucas Fugisawa, ago