code example for presenting the flyweight design pattern