Dynamic kind changes, mixins, item stamping
October 27th, 2004 at 11:28 am (3 years, 9 months ago) by Andi Vajda under chandlerdbIn order to support Item Stamping, the data model had to be enhanced to support changing an item’s kind on the fly. Like a class for an instance, a kind holds the schema information for an item, that is, the attributes it may have, the attributes it may inherit via the kind’s superKinds, and the class used to instantiate Item instances of that kind.
When a kind doesn’t specify which subclass of Item should be used, a composite class of the kind’s superKinds classes is created, ultimately defaulting to Item. Item Stamping is done by changing the item’s kind superKinds list. By adding or removing superKinds, a new mixin kind is created from the superKinds list - unless it existed already. A class is also dynamically created for this kind combining the classes of all its superKinds. Finally, changing an item’s kind - rekinding an item - involves comparing the attributes it may have before and after the operation. Values for attributes no longer allowed are simply removed, values for new attributes are initialized to their optional initial value.







