
29 Jun
2006
29 Jun
'06
4:09 p.m.
Joaquín Mª López Muñoz <joaquin@tid.es> writes:
The main difference is that flyweight<T> enforces that *every* flyweight object with the same value will have a pointer to the same internal representation.
Isn't this usually called "intern", at least when applied to strings?¹ I can see how "flyweight" captures the means of referring to the interned object, but the essential facility here is the interning, not the reference mechanism. Footnotes: ¹ http://www.lispworks.com/documentation/HyperSpec/Body/f_intern.htm http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html#intern() -- Steven E. Harris