Search code examples
umlmetadatametamodel

Defining a metamodel


My question might sound very stupid. But, can anyone please tell me what exactly a metamodel is. I know the technical definition and I have read a lot of papers on metamodels, but I dont seem to get the hang of it.

Suppose I have two classes like this:

class A{
    int m_a;
public:
    A(int a);
    void foo();
}; 

class B{
    int m_b;
public:
    B(int b);
    void bar();
}; 

Can anyone please tell me what information my metamodel will contain.

Thanks a lot


Solution

  • A metamodel describes the model you are using.

    Normally you would look at your example and see that there are two entities here : [A] and [B]. There is no relationship between them so you wouldn't draw a line. You could also describe its methods and parameters.

    A Meta-model would look at the elements which make up your model. And in this case you could list these things : [class], [method], [constructor], [field]. You could draw a line between class and method (1-to-many), as a class can have many methods (in general). You could also do the same to constructor and to field.

    Have a look on google for the UML Metamodel - it describes the relationship between all these things like classes/types/methods/behaviour etc. It can get pretty deep pretty quickly, so have fun diving :)