Overview of UML profiles
Definition
UML profiles are used to consider just one part of the J class methods, according to your field of interest.
They appear as prefixes of the methods which limit their visibility space. These prefixes are defined in MDA Modeler, and are never textually declared by you, the user.
Organizing J methods
The classes provided with the J language have a great number of methods, all of which provide different features.
These J methods allow you to produce C++ program generation of relational databases, documentation, …. UML profiles are used to organize these methods, by taking into account their specific objectives.
First example
"documentation"
and "GenCpp" are two UML profiles, to which the "generate()"
methods belong. According to the UML profile in question, "generate()"
indicates a different action:
Package:default#documentation#generate()
{ ...
}
Package:default#Cxx#generate()
{ ...
}
UML profile hierarchy
UML profiles
are organized hierarchically, the root of the hierarchy being the "default"
UML profile. This hierarchy
is used to define a new UML profile, "UMLprofile2", which
specifies a previously defined UML profile "UMLprofile1".
UML
profiles are, in fact, described in the form of a path which takes the
following form:
default#UMLProfile1#UMLProfile2
Generation adaptation mechanism
Applicable
to all Objecteering generators (C++, Java, C#, …), the UML profile mechanism is
used to redefine generation methods, in order to adapt them to a specific
requirement. Here are the steps to follow:
1. Define a UML profile in the UML profile dedicated to the generation in question (for example, Cxx#Specific).
2. Redefine the method you wish to adapt (for example, Attribute:Generate) in the new UML profile.
3. Run generation from this new UML profile.
Note: MDA Modeler
is used to carry out these operations.