I have this question. Why do we need flyweight design pattern when we can accomplish the same thing using static variables. The static variable (of a designated class for storing global states) can be used to save states dynamically and which can be accessed by different objects anywhere and anytime. The whole flyweight business seems very confounding.

What? No it can't. You're totally confused and I don't know where to begin except to say look at what the flyweight pattern is.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.