WeakValuePool caches domain values in a WeakHashMap
using them both as key and as value.
This is quite inefficient: To look up a domain value the
domain value itself is required as key, which can be
obtained only by creation of a domain value instance,
even if an appropriate instance is already available in the
pool. Futile object creation is the result.
An improvement would be to accept keys of any type
(e.g. String, so the domain value's string representation
could be used as key).
To achieve this, WeakValuePool must be able to create
domain values out of the given key - since they would
no more be created and delivered by its client.
A generic implementation could use one of the following
approaches:
1. core reflection
2. an abstract createValue operation (implemented in a
sub class of WeakValuePool)
3. a createValue command (provided by the owner of
WeakValuePool which would usually be its only client).