2009/9/13 Philippe Marschall
<philippe.marschall(a)gmail.com>om>:
2009/9/13 Lukas Renggli
<renggli(a)gmail.com>om>:
>>> I think you should not use #kind to instantiate new objects, but add
>>> your own property to hold the class you want to instantiate.
>>
>> That doesn't solve the problem that kind validation is borken for
containers.
>
> #kind is used for validation and that should remain like this. The
> default for containers is Object, so it is a no-op that passes the
> validation for all objects.
Not if you set kind on a container. And the check is not a no-op at
all. It checks the class of the memento against the kind which makes
no sense at all.
Of course, for what it is designed for it makes perfectly sense.
As I already said several times, forget about #kind, create your own
property that is not used for validation and do with it whatever you
want.
But why is #kind mutable on MADescription when setting it results in
failing validation? This is very bad API design. At least it should be
pushed down to MAElement description.