UML (OMG documents formal/2001-09-67) is the standard modeling language at the M2 level, defined using the MOF. A vast majority of the models that are being developed are UML models. To be able to use MDA in software development, it is therefore necessary to understand UML. 11.4.1 The UML MetamodelUML is the most widely used modeling language defined in the MOF. Figure 11-4 shows an extension of the UML metamodel used in Chapter 9 and Chapter 10. It is still a small and simplified part of the standard metamodel, describing only part of the language. The UML metamodel describes exactly how a UML model is structured. From the metamodel, we can deduce the following:
Figure 11-4. UML metamodel (simplified)
Any UML model must fulfill these rules; otherwise , it is not a proper instance of the UML metamodel. Because of this, we can reason about UML models knowing exactly what they look like and how they are structured. Relationship between UML and the MOFThe UML metamodel is an instance of the MOF model. In Figure 8-5 in Chapter 8, a small part of the UML metamodel is shown as an instance model, with each class in the UML metamodel being an instance of a MOF class. More commonly, the UML metamodel is shown as a model itself, as in Figure 11-4. Additionally, the UML metamodel has the same structure as the MOF model, reusing part of its definition. Because UML is used to model much more than metamodels only, it contains many more metaclasses than the MOF. Examples of this are the metaclasses needed for statecharts, interactions, and so on, in UML. 11.4.2 The Role of UML in MDAThere are two different ways in which UML can be applied in MDA. First, a developer must be able to use UML to create a model of the system that will be built. He should know how and where to apply the UML language to develop models that are precise and consistent enough to be used within MDA. There are many books available that give information on how to use UML for this purpose. A special and much smaller group of developers will have the task to define transformations between models. This group does not develop a model of a particular system, but instead defines transformations to be used for many models, models of many different systems. We will call these people metadevelopers. Like a developer, a metadeveloper must have a thorough understanding of the UML language and its usage. Additionally, he needs to be intimately familiar with the UML metamodel. It is in terms of this metamodel that he or she will need to define the MDA transformations. |