-
Notifications
You must be signed in to change notification settings - Fork 0
Class deletion & Class type conversion
This operation can happen on two situations:
-
When a M2-class is removed, all usage of that class (parameter type, references, M1-instances...) will go under type conversion trying to prevent data loss while mantaining a valid state. Subclasses of the removed class will extend his superclasses if he does have superclasses. The class usages will be converted to convert all of his usages, to his "closest" subclass or superclass.
-
When the user explicitely convert a single M1-class, or tells to convert all M1-instances of a M2-class to a new classType. For example converting all "Date" instances to "DateTime" instances, adding a "time" attribute to all of them without changing the definition of the "Date" class.
If "closest" is not explicitly defined by the user, it is computed with the following criteria.
- The one with all of his features and the least more features count (like a subclass).
- If there are no candidate classes with all of his features, the one with most of his features (like a superclass).
- If there are multiple candidates tying with criteria (1) and (2), the one with least more operations.
- If there are no candidate classes with all of his operations, the one with least less operations.
- If there still are multiple candidates, the one with least more annotations.
- If there are no candidate classes with all of his annotations, the one with least less annotations.
- If there is still ambiguity, prioritize subclasses over superclasses.
- If there is still ambiguity, take the oldest (definition date) subclass.
Parameter's type will just change without further cascading changes. M2-references will validate their M1-Reference instance values. If they became invalid due to type change, will be un-linked. M1-classes that suffered type change, will try to preserve the value of his features, eventually using primitive type conversion if they got redefined (shadowing). If their new type have less features, the ones in excess will be removed along their values.