Implementing Transformation Configuration Inheritance

You may create more than one TC for transforming a particular model. One reason for doing so could be to build different variants, for example a debug and a release version, of the same application. Often the majority of all properties in such variant TCs are identical, and there are only a few properties which have different values. To avoid duplicating properties in multiple TCs you can arrange your TCs in an inheritance hierarchy, where common properties are placed in a base TC which the other TCs inherit from. You would not build that base TC. It only serves as a common place for properties that apply to all inherited TCs, unless they override them.

Here is an example of a TC “Specific” that inherits from a base TC called “Common”:

The inheritance can also be seen in the Project Explorer (if you have set the preference RealTime Development – Project Explorer Show inherited transformation configurations):

Multiple inheritance of TCs is supported, i.e. a TC can have more than one parent TC.

When you change a property of a TC that inherits from another TC, the property will be marked in boldface. This shows that the property has been overridden in the inheriting TC. For example:

Note that the property may have a different or the same value in the inheriting TC as in the inherited TC. Boldface just shows that there is a value defined for the property in the inheriting TC.

There are also a few other visual indications of TC properties which are useful to know about. The picture below summarizes them:

There are several commands available in the TC editor which help you work with inherited properties. Commands that apply for a single property are located in the context menu of that property (right-click on the property label), while commands that apply for all properties in the TC are located in the toolbar menu in the TC editor.

You can navigate to an inherited TC by double-clicking on an entry in the "Inherited transformation configurations" list. This, combined with the command "Show in Project Explorer" which also is available in the toolbar menu of the TC editor, makes it easy to navigate between model projects that are related by means of TC inheritance.