A metamodel is a model that models the concepts of a modeling technique, i.e., the model elements that can be used and their interrelationships. A metamodel thus provides a formalized description of models that reflects the structure of a domain. A metamodel is also the fundamental basis of a modeling language, which also consists of an abstract syntax, static semantics, and concrete syntax. In turn, a metamodel is described by a model - the so-called metametamodel.
A well-known example of a metamodel is the Unified Modelling Language (UML), whose metamodel in turn is the Meta Object Facility (MOF). Likewise, a class in the Javaprogramming language is a metamodel, which in turn is defined by the Java programming language as a metametamodel. Metamodels are an important prerequisite in the context of model-driven software development (MDSD), whereby executable software is generated from formal models using an automated process. In addition to UML as a modeling language for models of applications, the Object Management Group (OMG) has standardized the Common Warehouse Metamodel (CWM) for modeling data. For this purpose, four so-called meta-layers were defined by the OMG.
The term metamodel was derived from the Greek prefix meta, which can be translated as above, beside or behind. A model serves to abstract reality, for the creation and description of which a language is required. For this purpose, the rules as well as the grammar of this language must also be defined. Exactly these languages are defined in so-called meta-models, which in turn are themselves written in a meta-language.
Process of Model BuildingThe classical process of model building leads from one problem domain at a time to a model of the model domain. Metamodeling describes the modeling technique used in the model domain in a model. The concept of a modeling technique includes the model elements that can be used and their interrelationships. A metamodel is explicitly not a model of a model, but a model of a model domain, i.e. a set of similar models - especially models created according to the same technique.
If a metamodel is to define the elements and constructs of a modeling technique precisely, the elements and constructs of the metamodel must be specified just as precisely. This requires the metamodel of a metamodel - this is sufficiently called a higher metamodel or meta-metamodel. Insofar as one follows this idea, this form of definition leads to an infinite sequence of metamodels. Since this does not make sense, the OMG has standardized the Meta Object Facility (MOF) as a meta language and, as it were, the highest instance of meta modeling.
M3 met amodel This top layer has the highest abstraction and defines the Meta Object Facility (MOF) according to the OMG specifications. The elements of MOF such as MOF Class, MOF Attributes, MOF Associations are used to define metamodels. Thus, the MOF layer specifies an abstract language to develop other modeling languages. Thus, all other modeling languages such as UML or CWM are instances of MOF.
M2 metamodel: This layer contains the metamodels that are described with the help of MOF constructs, each of which in turn specifies an abstract syntax and semantics. At this level, the OMG defines the two languages - UML and CWM - which are then used to model at the M1 level below. Often, however, the elements of the modeling languages, such as UML, are not sufficiently expressive for domain-specific modeling. This is then the approach for so-called UML profiles, which then extend the existing language scope of the UML in order to be able to adapt it to particular technical or business domains.
M1 model. This is where the models for representing the abstraction of a real system are stored.
M0 instance This layer represents the running system with its different states and real instance in memory. The objects at this layer represent instances of M1 objects and thus ultimately represent the real entities. The example of a book titled "UML" shown in the figure is an instance of the class Book modeled in the M1 layer. The properties of this book are then defined in the layer M1 above.