Tag: flyweight

  • How to implement Flyweight pattern in Java?

    Let’s say you are an artist. You want to create different Color Palettes using three colors at a time. The three colors can be anything of all colors know to us. Let’s represent this in Java code using Flyweight pattern and check what problems it solves. Flyweight pattern let’s you reuse objects instead of creating…