Lew <> wrote:
>I am mystified how it helps. What is the difference between
>Object obj = o; and Object obj = enhancedSet.find( o );
The difference is that the second will return the "canonical" instance of o,
where the first leaves you with multiple copies.
In the rather specialized case where you have many or large objects and you'd
rather keep one instance of each than many, and you for some reason don't want
to hide it all in a factory or manager, this can make it easy.
In every case I can think of, it's pretty easy to make a factory or FooSet
that's specific to the data and hides the implementation such that nobody
cares whether the Set interface has this method or the factory just keeps a
HashMap.
--
Mark Rafn
<http://www.dagon.net/>