Main Page

Documentation
Overview
Model Interfaces
Reflective Interface
Tailored Interface
Generation rules
Textual Notations
XMI and XMI+
JMI, PMI, CTF
Repository Facility
Structure
Repository Session
Program Sample
Tools
Universalis Viewer
Import/Export Facility
Conversion Tools
Publications
Samples
Metamodels
MOF
UML 1.3
Models
Notation Guide
A Bank Model
Model Instances
Bank instances
Projects (restricted access)
Groupe Méta
Pilote
|
|
Universalis Model Interfaces
Access to model elements can be achieved by
means of a generic interface (known as reflective) or by means of a
tailored interface, which depends on the metamodel. The tailored
interfaces are generated automatically according to generic
rules.
Reflective Interface
The aim of Universalis reflective interface is to provide a generic
capability for traversing models (independently of the metamodel
definition) and a generic capability for loading and storing models
in a model database.
The reflective API for Java and the reflective API for
Python have some minor differences because the design choices
in both languages are not exactly the same.
Tailored Interfaces
The tailored interfaces allow traversing models using the role and
attribute names of the underlying metamodel.
Each supported metamodel has its own tailored interface:
- The UML 1.3 Tailored API :
for Java,
for Python
- The MOF Tailored API :
for Java,
for Python
Generation rules
The tailored interfaces are automatically generated according to the
following rules:
- For each attribute, define a reader access method 'get<Attr>', a writer access method 'set<Attr>' and a cleanup operation 'reset<Attr>'. If the attribute type is of boolean type, the reader access method is named 'is<Attr>' instead of 'get<Attr>'.
- For each single-valued role, define a reader access method 'get<Role>', a writer access method 'set<Role>' and a remove operation 'remove<Role>'.
- For each multiple-valued role, define a global reader access method 'get<Role>s', an individual reader access method 'get<Role>', an add operation 'add<Role>' and an individual remove operation 'remove<Role>' and a global remove operation 'remove<Role>s'.
- For each single-valued role that refers to an association class in the metamodel, define a reader access method 'getlink<Role>' to the class instance representing the association. Add an argument to the 'set<Role>' operation to allow passing the association class instance.
- For each multiple-valued role that refers to an association class in the metamodel, define an individual reader access method 'getlink<Role>' and a global reader access method 'getlink<Role>s' operation to access the class instances reifying the association. Add an argument to the 'add<Role>' operation to allow passing the association class instance.
- For each association class in the
metamodel, define two inverse access methods to get both targets of
the reified association: 'getrlink<Role1>' and
'getrlink<Role2>'.
|