in reply to Re: Doubt about fly-weight objects.
in thread Doubt about fly-weight objects.

IIRC the point of flyweights is when you have a boatload of instances of a class and having each instance carry around the entire state would take a huge amount of memory.

No, all of the data still exists, it is just all stored in one big heap in the class, rather than piecemeal with each obect instance. Saying that this saves memory usage is kind of like saying that dropping something heavy from your hands will reduce the total mass of the universe. Flyweight objects are so named because they, themselves, consume next-to-no memory, but the total memory used is not reduced; it's just used in a different place (within the same process).

------------ :Wq Not an editor command: Wq