Title: UML to XMLSchema Transformation: a Case Study in Managing Alternative Model Transformations in Model
1- UML to XML-Schema Transformationa Case Study
in Managing AlternativeModel Transformations
inModel Driven Architecture - Ivan Kurtev, Klaas van den Berg, Mehmet Aksit
- University of Twente, the Netherlands
2Outline
- Alternative Model Transformations in MDA
- Case Study Transformation from a UML Class Model
into XML Schemas - Example Deriving Extensible XML Schemas
- Managing Alternative Transformations
Transformation Space - Construction of Transformation Space
- Reduction of Transformation Space
- Reduction of Transformation Space on the basis of
Quality Properties - Discussion
3Basic MDA Concepts
- Basic concepts in Model Driven Architecture
(MDA) - Models
- Model Transformations
- The MDA Pattern (from MDA Guide)
4Alternatives in Model Transformations
The model level (M1) and the meta-model level
(M2) in the four level Meta Object Facility (MOF)
modeling stack
M2 A given construct from the source meta-model
may be mapped to more than one construct in the
target meta-model. M1 This results into
alternative transformations for the instances at
level M1.
5The Problem with AlternativesGeneration and
Selection
- Problem 1 Lack of support for identification of
alternative transformations - Transformation to the desired model may not
always be obvious and trivial - Problem 2 Selection among Alternatives
- Alternatives differ in their Quality properties
such as Extensibility, Adaptability, Performance - Alternative Transformations Analysis must be
addressed explicitly in the MDA software
development process!
6Case Study UML to XML-Schema Transformation
7Example Deriving ExtensibleXML Schemas
UML Source Class Model
We aim at deriving extensible XML schemas.New
specializations of ExamItem are expected.This
might affect the representation of Exam in the
resulting schema.
8Two of many Alternative XML Schemas
Schema 1
Schema 2
ltelement nameexamItemgt ltcomplexTypegt
ltchoicegt ltelement nameopen
type/gt ltelement namemutipleChoice
type/gt lt/choicegt lt/complexTypegt lt/elem
entgt
ltelement nameexamItem
typeexamItemType
abstracttrue/gt .. lt/complexTypegt ltco
mplexType namemultipleChoiceTypegt
ltcomplexContentgt ltextension
baseexamItemTypegt .
lt/extensiongt lt/complexContentgt lt/complexTypegt lt
element namemultipleChoice
typemultipleChoiceType
substitutionGroupexamItem/gt
ltelement namefillInTheGap/gt
In the first schema it is not possible to extend
the alternatives of ltchoicegt. In the second
schema the addition is modular and does not
require changes in the rest of the schema
components.
ltelement namefillInTheGap
substitutionGroupexamItem/gt
9MDA Transformational Problem
The process of Alternatives Generation and
Selection is based on the notion of
Transformation Space
Selection is based on Quality Requirements
10Transformation Space
Alternative Space Analysis Activity
11Step 1 Constructing Transformation Space
- Set of dimensions one dimension for every
(relevant) element from the source model - Coordinate set for every dimension
- Coordinate selected among the constructs in the
target meta-model - Point in Transformation Space represents
alternative transformation for the source model
- Coordinate sets for XML Schema Meta-model
- Components
- Complex Type (CT)
- Element (E)
- Attribute (A)
- Attribute Group (AG)
- Model Group (MG)
- Relations
- Containment (Cont)
- Reference (Ref)
- Derivation (Der)
- Substitution (Subst)
12Example of Transformation Space
- The space includes only two classes from the
source model (ExamItem and Open) and the
generalization between them (denoted as
ExamItem_Open)
CT Complex Type E Element MG Model Group AG
Attribute Group Der Derivation Subst
Substitution Cont Containment Ref Reference
4 x 4 x 580 alternatives
13Step 2 Reducing Transformation Space
Two operations for selection and exclusion from a
space are defined.
Selection from space (e.g. ExamItem to Element
or Complex Type)
Exclusion from space (exclude Element and
Reference)
Exclude from S where lt(ExamItem_Open.E or
ExamItem_Open.Ref) gt
Select from S where lt(ExamItem.E or
ExamItem.CT) and (Open.E or Open.CT)gt
12 alternatives
20 alternatives
14Step 3 Reducing Transformation Space based
onQuality Requirements
- In this example the Quality Model is the model of
Extensibility - Model elements are
- Extensible
- Inextensible
- Our technique allows merging of quality
properties with a transformation space
15Merging Quality Properties with Transformation
Space
Operation Merge merges two spaces into one.In
our example the resulting space contains
information about the extensibility properties of
the model elements
The software engineer may be supported by
heuristics during the selection process. XML
Schema best practices may be used in our example
to select extensible schemas.
16Result Set of Alternative Transformations
- After applying some reduction steps and taking
into account the quality properties, two
alternative transformations from the space are
selected
Dimension in Source
Alternative Transformation
Coordinate in Target
17Conclusions
- We presented a technique for Alternative
Transformation Space Analysis for MDA
transformations - Transformation Space is the main concept in that
technique - Transformation Space
- Is NOT a transformer
- Is NOT a transformation specification
- Not all alternatives in the Transformation Space
are explicitly generated
18Discussion
- More complex mappings (not only 11)
- More complex quality models
- Balancing quality factors
- Tool support adaptation of existing prototype
- Handling large transformation spaces