In our previous episode, Graeme Geldenhuys said: > > this ever save memory? > > Please read the following... > > http://exciton.cs.rice.edu/JavaResources/DesignPatterns/FlyweightPattern.htm > > http://en.wikipedia.org/wiki/Flyweight_pattern > > Design Patterns - Elements of Reusable Object-Oriented Software > (aka GOF book) > "Most contemporary document editors don't use an object for every > character, presumably for efficiency reasons. Calder demonstrated that > this approach is feasible in his thesis [Cal93]. Calder's glyphs can > be shared to reduce storage costs, thereby forming directed-acyclic > graph structures. We can apply the Flyweight pattern to get the same > effect." ? A Case Study (chapter) > > [Cal93] - Paul R. Calder. Building User Interfaces with Lightweight > Objects. PhD thesis, Stanford University, 1993.
Like everybody, I have read GOF several times, and even got some of the successor books. The problem is how it applies to strings, and how they can be more memory saving than a straight array of 16-bit values which are copy-on-write. _______________________________________________ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel