No translation from UML to code. This is due to a number of reasons, including:
What UML bits you use and how. UML is a great language. Historically, this was much stronger on the static side of things (classes, associations, packages) than on dynamics. More recently, UML has acquired the action semantics required for executable models. And compared to more established static elements, these new parts are not yet supported. This was probably the main reason why canonical transformations of MDA did not become more common.
You can configure various programming languages. Translation into third-generation OO languages ββis probably the most popular. But it is also possible to translate into other languages: C is a popular choice, especially in the embedded world.
Different translation rules are possible depending on the needs of a particular environment.
However, there are some popular idioms. For instance:
- UML packages, classes, and attributes are often mapped directly to their OO 3GL peers. In fact, many UML models are simply graphical versions of the 3GL OO code.
- UML relationships are usually divided into two parts: pointers / links are stored at each end of the relationship.
- There are three common models for translating UML state models (or, more generally, any state model): nested switches, state tables, and a state template.
Action Languages ββare too new / not well supported to be canonical mappings. However, the specifications pretty closely reflect typical 3GL constructs: if / then / else control statements, assignments, etc. Thus, the semantic gap between the model and the goal is quite small - therefore, the translation should be quite simple.
NTN.
source share