Other Marks

The marks that we've described so far have applied to the elements of a model constructed by the developer, but other kinds of marks exist as well.

For example, we could define a mark "_C" that we postfix to all class names to make it easier to distinguish them from other kinds of elements in the eventual code. This postfix would apply to all classes, not just certain selected classes. As these marks apply to all classes that the mapping function transforms, this mark is not linked to any model elements; rather, it is a global configuration mark.

Marks may also apply to instances of classes of the developer models. For example, a telephone system will have some set of classes related to the phones we each use. The instances of those classes need only exist on the switch considered "local" to that phone. Since the instances don't exist explicitly in the developer's model, these instances cannot be marked directly. Instead, they may be described in some manner, using, for example, an area code, or perhaps a separate model will be constructed that provides initialization values for the instances.

Mapping functions can also produce marks for the target model as outputs, which can be useful if the mapping needs to remember how the source and target model elements map to each other. Another useful application of target marks is to allow one mapping to use the output of the other as its input. The target marks of the one are then used as the source marks of the other mapping function. We discuss these chains of mappings in more detail in Chapter 11.

MDA Distilled. Principles of Model-Driven Architecture
MDA Distilled. Principles of Model-Driven Architecture
ISBN: B00866PUN2
Year: 2003
Pages: 134

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net