Entity Merging/Structure Abstraction
This is a modularisation pattern which
specialises Phased Construction.
One target model
is updated using
data from two or more different source model entity types.
should be used to define the updates
from separate sources.
This pattern is
used when a target entity type
data from several different source entities. The target entity type will
appear in the succedent of two
or more rules and each rule will create
or update instances of it.
Define the separate updates as
creating the target instance in
the first rule, and using some means of object
lookup to locate this instance for update by subsequent
In cases where a closely semantically
related group of source elements are
mapped to a single target element,
using a multiple matching rule, separate
rules are not suitable. This could be
termed the Structure Abstraction
This pattern can be used to improve the decomposition
of the specification, simplifying individual rules.
It should be checked that rules Ri and
Rj which may update the
do not semantically
interfere with each other:
they either update entirely separate
sets of features of the instance, or they
update shared features (which must
be set-valued association ends), in a
consistent and order-independent
way (by both
adding elements to the
This enables the rules to be
implemented by successive phases.
The mapping of identity attributes from source objects
to target objects can be non-injective, but in such a case
successive updates to the same target object from
different source objects
must also be non-interfering.
Applications and examples
is applicable to the same categories of
transformations as Phased Construction,
but it is particularly relevant to
abstraction transformations or to
model-merging transformations, which
combine two separate models into
a single model.
An alternative form of the UML to
relational database transformation could
take account of inheritance in the
source model, and only creates relational
tables for root classes in the
source model inheritance
hierarchy, the data of
subclasses is then merged into these
Tables are created (for root classes
only) by one rule and then
updated by another, so this
transformation conforms to the pattern.
The pattern is a special case of
This pattern is referred to as
the global source to
type of transformation in
(Cuadrado et al, 2009). The node abstraction pattern in
(Iacob et al, 2008) corresponds to
a case of Structure Abstraction, as
The reverse transformation of an
entity merging is an entity splitting
In order to look up already existing
t : T1 objects, to update them with
additional data, some mechanism such
as trace-based lookup or the
must be used.
The pattern can be extended
to the Model Merging
in cases where the
input model can be split into smaller
models, together with a separation of
the transformation into target
creation and elaboration sub-transformations.
(Cuadrado et al., 2009) J. Cuadrado, J. Molina,
Modularisation of model transformations
through a phasing mechanism, Software Systems
Modelling, Vol. 8, No. 3, pp. 325--345, 2009.
(Iacob et al, 2008) M. E. Iacob, M. W. A. Steen,
Reusable model transformation patterns,
Enterprise Distributed Object Computing Conference Workshops,
2008, pp. 1--10, doi:10.1109/EDOCW.2008.51.