The Flyweight Design Pattern

Good article on caching for J2EE apps at The Server Side

Comments

RE: The Flyweight Design Pattern

cool article, being such a novice insofar as formal education relating to programming goes i had never heard of Flyweight, very simple and obviously very effective.

But I would not really call it a "cache". To me, maybe I am incorrect, cache implies temporary and subject to changes that must be updated? This I guess could be called a "cache" but it seems that the canonical cache objects will just always be there, always the same, none of the complexities of update and such normally associated with caching.

RE: The Flyweight Design Pattern

Yeah. *REALLY* THe Flyweight is what persistence systems like JDO and Castor are centered around, as an "obvious practice" system. Its really more about maintaining your model in ram and hitting back to the datastore when you need to refresh it. I'm kinda usinging a halfassed version of this for the jTOTSP model layer, but its a little tricky since I don't want to use static datasets because I want someone to have the option to deploy multiple jTOTSPs in the same JVM.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.