ADOxx Documentation
Theory - Hands-On - Scenarios - Community - Development Tools
Theory
Conversion
The class attribute "__Conversion__" defines and controls the conversion of a modeling object from one class to another.
When converting three things happen. First a new object of the defined class is created. Afterwards all attribute values are copied into the new object as defined in the "Conversion" attribute. In the end the old object is deleted.
Commands and Parameters for Conversion
CLASS "ClassName"
Specifies that an object can be converted into the target class <ClassName>. Several target classes can be specified.
ATTR "AttrName"
Defines the attributes from which the values will be copied during the conversion.
from
This parameter is used if values should be copied from the source object to the target object, but the corresponding attributes have different names. from specifies the name of the source attribute.
Commands and Parameters for Conversion
If you define "__Conversion__" for the class "A" with
CLASS "B"
ATTR "ba1"
ATTR "ba2" from: "aa3"
Conversion : | { ClassConversion } |
ClassConversion : | CLASS className { AttrConversion } |
AttrConversion : | ATTR attrName [ from: attrName ] |
means that
- objects of class "A" can be converted to objects of class "B"
- the aa1 is assigned from A to ba1 in B as they have the same name
- the aa3 from A is assigned to ba2 from B as they have different names.