|
|
|
The Model-Driven System Builder
|
|
JeeWiz Architect's Guide
|
|
|
|
Contents
|
|
|
Chapter 5. Meta-Model Inheritance
Meta-Class References Between Meta-Models
|
To support multiple meta-models and meta-model inheritance,
JeeWiz supports references to meta-classes and factors in other meta-models.
Usually, this is done by referencing the meta-class or factor simply by its name.
JeeWiz implements a search order for such references,
starting with the current meta-model (i.e. the one being compiled into Java),
and then walking down the inheritance chain.
For example, the inheritance chain from the business-object meta-class in the Business Object meta-model
is shown in the following diagram.
The business-object and internal-class meta-classes are from the Business Object meta-model;
the jwclass and reference-type meta-classes are from the Java meta-model.
We put '(object)' after this because that is the directory to look in for the Java meta-model.
The arrows are the diagrammatic representation of the inheritance structure, whereas
the 'extends=...' attribute is the XML you write to reflect this in the meta-model.
Where the standard lookup would identify a meta-class in the wrong meta-model,
it is possible to specify the meta-model in the reference by prefixing the target meta-class's name
with the name of the target meta-model and ':'.
This occurs quite commonly when we have a 'logical' meta-model (like business-object)
that has a 'physical' meta-model (like J2EE or other enterprise Java stacks) that inherits from it,
because the meta-classes in both meta-models usually have the same name.
This occurs with the entity meta-class:
the physical one in J2EE is just a more specialised representation of the business-object concept.
It makes sense then to use the same meta-class name in both meta-models, rather than invent another name.
If we wrote in the J2EE entity 'extends="entity"', this would be wrong:
the standard search order would pick up the J2EE entity.
So it is necessary to prefix it with "business-object:" to force the search to start at the business object meta-model.
| |