From: Joaquín Mª López Muñoz (joaquin_at_[hidden])
Date: 2006-06-30 09:25:19
"Steven E. Harris" ha escrito:
> Joaquín Mª López Muñoz <joaquin_at_[hidden]> 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.
Well, at least in my experience I had never heard of that "intern"
terminology. Reading the links you provide, seems to me like the term
is used to refer to the factory part of the Flyweight Design Pattern,
and the the pattern is somewhat broader than the intern thing only, as
it accounts for other participating agents, see for instance.
If you want to see this way, the flyweight<...> class I'm proposing automates
the Client part as described in the link above.
Anyway, naming discussions aside, do you see value in such a thing
being elaborated and eventually proposed to Boost?
> ¹ http://www.lispworks.com/documentation/HyperSpec/Body/f_intern.htm
> Steven E. Harris
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo