9.1 Language Architecture
The UML is defined within a scheme called a four-layer metamodeling architecture that involves four distinct layers or levels of abstraction. Each layer defines elements, concepts, and relationships between concepts, based on the types of elements in the next more general layer.
For example, consider how we define programming languages and programs using the following layers:
Within this scheme, as each layer has more concrete or specific elements, the "meta" phrase is dropped and the layer number decreases.
For a programming language, the M2-level layer defines the programming language with data types and types of processing statements, the M1-level layer defines a program with specific data variables and specific processing statements using the elements defined in the M2-level layer, and the M0-level layer is an executing program that is defined in the M1-level layer using the data types and types of processing statements defined in the M2-level layer. This is very natural in that an executing program (M0-level layer) is an instance or a specific execution of a defined program (M1-level layer) that uses the data types and types of processing statements of the programming language (M2-level layer).
Similarly, for the UML, we say a model, depicted using class diagrams, is an instance of a metamodel; a user model, depicted using object diagrams, is an instance of a model depicted using class diagrams; a user model, depicted using object diagrams, is an instance of a metamodel; and objects and links are instances of their classes and associations.
This scheme of defining and organizing a language is important in helping us define the language and how it is used; otherwise, a language would be a hodgepodge of different types of modeling elements, concepts, and relationships between concepts, without any thought of how the language is defined and how it may be used.
Similar to how the Java programming language is defined at the metamodel layer, the UML is defined at the metamodel layer as follows:
To ensure that the UML remains standardized, we are unable to modify the metamodel that defines the language. But to ensure that the UML is extensible, we are able to extend the language by defining new concepts using stereotypes, describing them using properties, and packaging and reusing them using profiles.