pattern conforming to the pattern metamodel can be
transformed into the QVT Template.
This textual QVT template representation can be
understood in the following way: “return all the
matchings composed by three tables (a, b and m)
and two foreign keys (fk
1
and fk
2
). Those elements
must hold the following conditions: a is related to
fk
1
, b is related to fk
2
, m is related to fk
1
and m is
related to fk
2
”.
In this pattern, the criteria to process the search
are only based on the structure of the elements
composing the pattern. In another situation, it may
be useful to establish another kind of conditions.
3.3.3 MDPEM Application
Given the QVT template (representing the pattern)
and the target model (
Figure 3), the QVT engine
looks for all the occurrences (matchings) of the
template that exist in the model.
Figure 6: Matching obtained from the working example.
As a result, a set of sub-models from the target
model, holding the constraints set by the pattern, are
returned to the invoker.
Because all the matchings are “fragments” of the
target model, all of them belong to the same level of
the target model (
Figure 1).
The only obtained matching (
Figure 6) consists of
a set of classes that hold the a, b and c tables and the
foreign keys fk
1
and fk
2
4 PURPOSE OF MATCHINGS
Matchings may be useful when a particular purpose
is bound to patterns. For example, a pattern such as
DFK could be accompanied by abstract operations.
Each abstract operation involves those tables
included in the pattern, so, when a matching is
found, this abstract operation can be applied to a
real set of tables. The real result of this matching is a
set of operations associated with the pattern.
The DFK pattern can be accompanied by the
following operations: getA_ForAGiven_B (having
B, obtain the associated A) and getB_ForAGiven_A
(the opposite). The combination “pattern+actions”
can be a powerful tool to deal with complex
systems. Another possible use for MDPEM could
also be the design pattern detection in large software
systems, such as other authors do (Zhang et al.,
2004).
5 CONCLUSIONS AND FUTURE
WORK
In this paper, a framework for Model-Driven Pattern
Matching has been presented. To perform MDPEM,
both the pattern and target models must be known.
To ensure compatibility among these models we
propose using the metamodel of the target model (or
at least a subset) to build the pattern. Thus any given
pattern can be used to find matchings in a given
target model.
Because each pattern must be translated into a
QVT Template, a suitable transformation must be
developed. An excerpt of a transformation to obtain
QVT Templates from our patterns is presented.
ACKNOWLEDGEMENTS
This work has been partially supported by the
ENIGMAS Project (PIB-05-058), the FAMOSO
Project (2006: FIT-340000-2006-67); and the
MECENAS project (PBI06-0024).
REFERENCES
Bézivin, J. (2006). Introduction to Model Engineering,
ATLAS Group (INRIA & LINA), Nantes.
García-Rodríguez de Guzmán, I., M. Polo and M. Piattini
(2006a). A Methodology for Database Reengineering
to Web Services. European Conference on Model
Driven Architecture - Foundations and Applications,
Bilbao (Spain), Springer-Verlag Berlin Heidelberg.
García-Rodríguez de Guzmán, I., M. Polo and M. Piattini
(2006b). Un primer paso para la obtención de
servicios en bases de datos relacionales mediante
patrones y MDA. ZOCO: Desarrollo y Mantenimiento
Ágil de Aplicaciones Basadas en Servicios Web,
Sitges (Barcelona).
OMG (2003a). MDA Guide Version 1.0.1., Object
Management Group: 62.
OMG (2003b). QVT-Partners initial submission to qvt-
rfp, Object Management Group.
OMG (2003c). Revised submission for MOF 2.0
Query/Views/Transformations RFP, Object
Management Group.
OMG (2005a). MOF QVT Final Adopted Specification,
Object Management Group.
:FK
+name='User_Renting_FK'
Table
+name=Film
:Table
+name=Rent
:Table
+name=Client
:FK
+name=Rented_Film_FK
+mMainTable
+mSecTable+mSecTable
+mMainTabl
ICEIS 2007 - International Conference on Enterprise Information Systems
556