ArticleslgStudy

engineering

Model transformation

Model transformation is a engineering topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Model transformation rather than just read about it. In short: A model transformation, in model-driven engineering, is an automated way of modifying and creating platform-specific model from platform-independent ones. An example use of model transformation is ensuring that a family of models is consistent, in a precise sense which the software engineer can define.

Key takeaways

  • Model transformation belongs to engineering; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Model transformation to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Model transformation from memory before moving on to harder problems.

Reference excerpt

A model transformation, in model-driven engineering, is an automated way of modifying and creating platform-specific model from platform-independent ones. An example use of model transformation is ensuring that a family of models is consistent, in a precise sense which the software engineer can define. The aim of using a model transformation is to save effort and reduce errors by automating the building and modification of models where possible.

Overview Model transformations can be thought of as programs that take models as input. There is a wide variety of kinds of model transformation and uses of them, which differ in their inputs and outputs and also in the way they are expressed. A model transformation usually specifies which models are acceptable as input, and if appropriate what models it may produce as output, by specifying the metamodel to which a model must conform.

Classification of model transformations Model transformations and languages for them have been classified in many ways. Some of the more common distinctions drawn are:

Number and type of inputs and outputs In principle a model transformation may have many inputs and outputs of various types; the only absolute limitation is that a model transformation will take at least one model as input. However, a model transformation that did not produce any model as output would more commonly be called a model analysis or model query.

Endogenous versus exogenous Endogenous transformations are transformations between models expressed in the same language. Exogenous transformations are transformations between models expressed using different languages. For example, in a process conforming to the OMG Model Driven Architecture, a platform-independent model might be transformed into a platform-specific model by an exogenous model transformation.

Unidirectional versus bidirectional A unidirectional model transformation has only one mode of execution: that is, it always takes the same type of input and produces the same type of output. Unidirectional model transformations are useful in compilation-like situations, where any output model is read-only. The relevant notion of consistency is then very simple: the input model is consistent with the model that the transformation would produce as output, only. For a bidirectional model transformation, the same type of model can sometimes be input and other times be output. Bidirectional transformations are necessary in situations where people are working on more than one model and the models must be kept consistent. Then a change to either model might necessitate a change to the other, in order to maintain consistency between the models. Because each model can incorporate information which is not reflected in the other, there may be many models which are consistent with a given model. Important special cases are:

bijective transformations, in which there is exactly one model which is consistent with any given model; that is, the consistency relation is bijective. A pair of models is consistent if and only if it is related by the consistency bijection. Both models contain the same information, but presented differently. view transformations, in which a concrete model determines a single view model, but the same view model might be produced from many different concrete models. The view model is an abstraction of the concrete model. If the view may be updated, a bidirectional transformation is needed. This situation is known in the database field as view-update. Any concrete model is consistent with its view. It is particularly important that a bidirectional model transformation has appropriate properties to make it behave sensibly: for example, not making changes unnecessarily, or discarding deliberately made changes.

Languages for model transformations

A model transformation may be written in a general purpose programming language, but specialised model transformation languages are also available. Bidirectional transformations, in particular, are best written in a language that ensures the directions are appropriately related. The OMG-standardised model transformation languages are collectively known as QVT. In some model transformation languages, for example the QVT languages, a model transformation is itself a model, that is, it conforms to a metamodel which is part of the model transformation language's definition. This facilitates the definition of Higher Order Transformations (HOTs), i.e. transformations which have other transformations as input and/or output.

See also Model-driven engineering (MDE) Model-driven architecture (MDA) Domain-specific language (DSL) Model transformation language Refinement Transformation (disambiguation) Program transformation Data transformation Graph transformation

References

Further reading Model Driven Software Engineering in Practice, Marco Brambilla, Jordi Cabot, Manuel Wimmer, foreword by Richard Soley (OMG Chairman), Morgan & Claypool, USA, 2012, Synthesis Lectures on Software Engineering #1. 182 pages. ISBN 9781608458820 (paperback), ISBN 9781608458837 (ebook) http://www.mdse-book.com

Worked examples

Example 1 — a first encounter with Model transformation

Start with the simplest possible case. Write down what Model transformation claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In engineering, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Model transformation before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Model transformation ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Model transformation

In research
Model transformation appears in engineering research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Model transformation in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Model transformation is common in secondary-school and first-year university syllabi. It links to neighbouring topics Systems engineering, Unified Modeling Language, so understanding it makes those chapters shorter.
In everyday life
Look for Model transformation outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.

Affiliate

Preply — study more efficiently by working with a personal tutor. 50% off.

How to study Model transformation in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Model transformation means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Model transformation out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Model transformation in simple terms?

A model transformation, in model-driven engineering, is an automated way of modifying and creating platform-specific model from platform-independent ones. An example use of model transformation is ensuring that a family of models is consistent, in a precise sense which the software engineer can def…

Why does Model transformation matter?

Because it connects several engineering ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Model transformation?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Model transformation.

Tags

  • Systems engineering
  • Unified Modeling Language

Keep exploring