SlideShare a Scribd company logo
MODEL-DRIVEN ENGINEERING
in Practice
The $800-Million Bombshell (Motivation)
• The following was the code for controlling long-distance
phone traffic routing in USA:
• …
switch (caseIndex) {
case‘A’: route = routeA;
…
break;
…
case‘M’: route = routeM;
…
case‘N’: route = routeN;
…
break;
…}
Missing “break”
statement!
When this code ran (in 1990), the entire US Northeast lost
long-distance phone service
Engineering Model
A reduced representation of some system that highlights
the properties of interest from a given viewpoint
Functional ModelModeled system
 We don’t see everything at once
 We use a representation (notation) that is easily understood for
the purpose on hand
Models vs. Systems
Differences due to:
• Unique properties of actual
construction materials
• Construction methods
• Scaling-up effects
• Skill sets/technologies
• Misunderstandings
Can lead to serious errors and
discrepancies in the realization
Characteristics of Useful Models
• Abstract
• Emphasize important aspects while removing irrelevant ones
• Understandable
• Expressed in a form that is readily understood by observers
• Accurate
• Faithfully represents the modeled system
• Predictive
• Can be used to answer questions about the modeled system
• Inexpensive
• Much cheaper to construct and study than the modeled system
To be useful, engineering models must satisfy
all of these characteristics!
ModelTransformations • Computation-independent
Model
• Uses natural language
• Ex: state-chart diagram
CIM
• Platform-independent Model
• Does not specify any technology
PIM
• Platform-specific Model
• Built for a specific technology
• When technology evolves, a
new PSM can be generated
rather than rewriting it
PSM
BusinessAnalyst
Architect / Designer
Developer /Tester
Machine Code
Impossible?
TheAbstraction Gap
• Middleware makes MDA a potential reality
Level of
Abstraction
Generators
1
0..*
security
mortgages
1
0..*
borrower
mortgages
10..*
ownerhouses
House
-value:Money
Person
-ssn:Integer
-salary:Money
+getMortgage(sum:Money,security:House):Mortgage
Mortgage
-principal:Money
-monthlyPayment:Money
-start:Date
-end:Date
Machine Code with Operating System
Impractical?Use Operating System facilities
Unlikely?Use Middleware
Practical(ly)
Middleware with
Framework
Today!
AbstractionGap
Model Execution
X = cos (h + p/2)
+ x*5
X = cos (h + p/2)
+ x*5
?
 By formal analysis
 mathematical methods
 reliable (theoretically)
 software is very difficult to
model mathematically!
?
X = cos (h + p/2)
+ x*5
X = cos (h + p/2)
+ x*5
 By experimentation (execution)
 more reliable than inspection
 direct experience/insight
X = cos (h + p/2)
+ x*5
X = cos (h + p/2)
+ x*5
?
 By inspection
 mental execution
 unreliable
MDE Prospects
• The problem:
• We cannot keep implementing our applications using the
programming technologies of the late Fifties’
• The demands on functionality, reliability, dependability,
availability, security, and performance demanded of modern
software.
• We need to, can do, and have already done better!
• MDE:
• Increased levels of abstraction
• Open unified standards
• Increased levels of automation
Primary Forms of Automation for MDE
• Computer-based validation
• Formal methods (qualitative and quantitative)
• Computer-based testing
• Automated test generation, setup, and execution
• Computer-based model execution
• Particularly execution of abstract and incomplete models
-- when most of the important decisions are made
• Model transformations
• Code generation, between PSMs, …
MDE - Case Study
Project Description
• A simple web-based J2EE e-commerce system (Pet Store)
• Users can sign into a system and manage their accounts.
• Users can browse a catalogue of pets on the web site
(such as birds, fish or reptiles).
• Shopping cart functionality: Users can add pets to their
shopping cart and manage their shopping carts.
• Order functionality: Users can place an order for the
contents of their shopping carts.
• Web services. Users can query orders via a web service.
MDE - Case Study
Teams Description
• 2 development teams
• Traditional development lifecycle
• Model-driven Development style
• 1 senior J2EE architect + 2 experienced J2EE programmers per team
• Each team uses the same HTML, images and database schema.
• MDA team was required to use an MDA tool
• Traditional team was required to use leading J2EE IDE
• Both teams must use EJB in their code bases
• No further constraints
Savings Achieved
0% 36% 46% 28% No data
available
Total average savings achieved: 26%
Quantitative Results
development hours spent by each team:
Team Original Estimated
Hours
Actual Number of
Hours
Traditional team 499 507,5
MDA team 422 330
this corresponds to a 35% increase in
productivity when using MDA
QVT - Overview
• QVT stands for Query/Views/Transformations
• OMG standard language for expressing queries, views,
and transformations on MOF models
• Defines three model transformation languages. All of
them operate on models which conform to MOF 2.0
meta-models
QVT Transformation Languages
• QVT-Operational Mappings
• imperative language designed for writing unidirectional
transformations
• QVT-Relations
• declarative language designed to permit both unidirectional
and bidirectional model transformations
• QVT-Core
• declarative language designed to be simple and to act as
the target of translation from QVT-Relations
QVT Operational Structure
QVT MMb
Mb
conformsTo
conformsTo
based on
conformsTo
conformsTo
MOF
MMa
Ma
conformsTo
conformsTo
conformsTo
M1
M2
M3
Engine
Tab
based on
input output
executed
Operational Mappings in Use
• Case study: Flattening UML class hierarchies
Flattening UML Class Hierarchies
• Given a source UML model, transform it to another UML model
in which only the leaf classes (classes not extended by other
classes) in inheritance hierarchies are kept.
Rules:
• Transform only the leaf classes in the source model
• Include the inherited attributes and associations
• Attributes with the same name override the inherited
attributes
• Copy the primitive types
Example Input Model
name : String
ssn : String
Person
school : String
EnrolledInSchool
organizationName : String
Employed
Student Employee
«primitive type»
String
CarPhDStudent
firstName : String
lastName : String
FullName
name : FullName
Professor
carOwnership
supervisor
name : String
Course
street : String
city : String
Address
residesAtattends
Example Output Model
«primitive type»
String
Carname : String
ssn : String
school : String
PhDStudent
firstName : String
lastName : String
FullName
name : FullName
ssn : String
organizationName : String
Professor
carOwnership
supervisor
name : String
Course
street : String
city : String
Address
residesAtattends residesAt
ModelTransformation Expressed in
Operational Mappings Language
Overall structure of a transformation program:
transformation SimpleUML2FlattenSimpleUML(in source : SimpleUML
out target : SimpleUML);
…………………………………………………………………
main() {}
…………………………………………………………………
…helpers……………………………………………
…mapping operations………………
Signature:
Declares the transformation
name and the source and
target metamodels.
in and out keywords indicate
source and target model
variables.
Entry point:
The execution of the transformation starts here by
executing the operations in the body of main
Transformation elements:
Transformation consists of mapping operations
and helpers. They form the transformation
logic.
Mapping Operations
• A mapping operation maps one or more source
elements into one or more target elements
• Always unidirectional
• Selects source elements on the base of a type and a
Boolean condition (guard)
• Executes operations in its body to create target
elements
• May invoke other mapping operations and may be
invoked
• Mapping operations may be related by inheritance
Mapping Operations: Example (1)
• Consider the rule that transforms only leaf classes
• Selects only classes without subclasses
• Collects all the inherited properties
• Creates new class in the target model
mapping Class::leafClass2Class(in model : Model) : Class
when {not model.allInstances(Generalization)->exists(g |
g.general = self)}
{
name:= self.name;
abstract:= self.abstract;
attributes:=
self.derivedAttributes()->map property2property(self)->asOrderedSet();
}
Operation body
Signature and guard
name:= self.name;
abstract:= self.abstract;
attributes:=
self.derivedAttributes()->map property2property(self)->asOrderedSet();
Mapping Operations: Example (2)
mapping Class::leafClass2Class(in model : Model) : Class
when {not model.allInstances(Generalization)->exists(g |
g.general = self)}
Operation nameSource element
type
An optional sequence of
input/output parameters
Target element type
Guard
Operation Signature and Guard
The Guard is an OCL expression used to filter source elements of a given
type.The mapping operation is executed only on elements for which the
guard expression is evaluated to true.
name:= self.name;
abstract:= self.abstract;
attributes:=
self.derivedAttributes()->map property2property(self)->asOrderedSet();
The predefined variable self refers
to the source element on which the
operation is executed
The left-hand side of the
assignments denotes
properties of the target
element
Invocation of helper derivedAttributes
The keyword map is used to invoke
another mapping operation named
property2property over the
elements returned by the helper
derivedAttributes
Mapping Operations: Example (3)
The mapping operation body contains initialization expressions for the properties of
the target element.When an operation is executed over a source element the self
variable is bound to it and an instance of the target type is created.Then the
operation body is executed.
Operation Body
• Helpers are operations associated to a type that return a
result
• Both primitive and model types can be used
• Helpers may be used to perform complex navigations over
source models
• Helpers have:
• List of input parameters
• An executable body
Helpers
Helpers Example
query Class::derivedAttributes() : OrderedSet(Property){
if self.generalizations->isEmpty() then self.attributes
else
self.attributes->union(
self.generalizations->collect(g |
g.general.derivedAttributes()->select(attr |
not self.attributes->exists(att | att.name = attr.name)
)
)->flatten()
)->asOrderedSet()
endif
}
The context type of the helper
derivedAttributes Result type
Invoking Mapping Operations
……………………………………………………
attributes:=
self.derivedAttributes()->map property2property(self)->asOrderedSet();
……………………………………………………
mapping Property::property2property(in ownerClass : Class) : Property{
name:= self.name;
type:= self.type;
owner:= ownerClass;
}
Invocation of property2property on every
member of the set returned by
derivedAttributes query
Constructs for Managing the Flow of Control
• There are cases where more sophisticated control flow is needed.
The following imperative constructs are available:
• While
• forEach
• Break
• Continue
• If-then-else
QVT Future Improvements
• Tool support is still insufficient
• Many issues need further exploration:
• Performance;
• Testing;
• Scalability of transformations;
• Ease of use;
• Handling change propagation;
• Reuse mechanisms.
Thank you!
Presented by:
Anas Omar Basha
Hussein Al-shukheir
Abd Al-massih Yakeen
Munir Kamal
Hisham Alatrash

More Related Content

PPTX
Explicating and Reasoning with Model Uncertainty by Marsha Chechik (ECMFA'14 ...
PPT
Intro Uml
PPTX
ProgrammingPrimerAndOOPS
PPT
PPTX
fUML-Driven Design and Performance Analysis of Software Agents for Wireless S...
PDF
[2016/2017] Architectural languages
PDF
ATL tutorial - EclipseCon 2009
PPTX
Unit4 desiging classes
Explicating and Reasoning with Model Uncertainty by Marsha Chechik (ECMFA'14 ...
Intro Uml
ProgrammingPrimerAndOOPS
fUML-Driven Design and Performance Analysis of Software Agents for Wireless S...
[2016/2017] Architectural languages
ATL tutorial - EclipseCon 2009
Unit4 desiging classes

What's hot (16)

PPT
Uml Omg Fundamental Certification 1
PPT
P Training Presentation
PPT
02 uml
PDF
Programmatic Muddle Management
PPSX
Programming in UML: An Introduction to fUML and Alf
PDF
The road ahead for architectural languages [ACVI 2016]
PPT
Executable UML and SysML Workshop
PPT
Unit 4 designing classes
PPS
Design Patterns For 70% Of Programmers In The World
PDF
Java quick reference
PPTX
Chapter 9:Representing Object-Oriented Concepts with UML
PPT
Ecmfa2013
PDF
Software Engineering :UML class diagrams
PPT
Uml - An Overview
PDF
How to make Robust and Scalable Modeling Workbenches with Sirius - SiriusCon ...
PPTX
Uml Omg Fundamental Certification 1
P Training Presentation
02 uml
Programmatic Muddle Management
Programming in UML: An Introduction to fUML and Alf
The road ahead for architectural languages [ACVI 2016]
Executable UML and SysML Workshop
Unit 4 designing classes
Design Patterns For 70% Of Programmers In The World
Java quick reference
Chapter 9:Representing Object-Oriented Concepts with UML
Ecmfa2013
Software Engineering :UML class diagrams
Uml - An Overview
How to make Robust and Scalable Modeling Workbenches with Sirius - SiriusCon ...
Ad

Similar to MDE in Practice (20)

PPTX
MODEL-DRIVEN ENGINEERING (MDE) in Practice
PDF
Introduction to MDE
PDF
MDD with Executable UML Models
PDF
Enriching Tool Support for Model-Driven Software Development
PDF
Model-Driven Software Engineering in Practice - Chapter 4 - Model-Driven Arch...
PDF
Model-Driven Software Engineering in Practice - Chapter 10 - Managing models
PDF
Domain Driven Design
PPT
MDE=Model Driven Everything (Spanish Eclipse Day 2009)
PPT
ERP_Up_Down.ppt
PPT
Web technologies: Model Driven Engineering
PPTX
The secret life of rules in Software Engineering
PPT
Abbott's Textual Analysis : Software Engineering 2
PDF
5 - Architetture Software - Metamodelling and the Model Driven Architecture
PPT
Oomd unit1
PDF
Software design with Domain-driven design
PDF
Modelado flexible basado en facetas
PDF
Facets_UCM
PDF
Overcoming The Impedance Mismatch Between Source Code And Architecture
PDF
Mda introduction and common research problems
MODEL-DRIVEN ENGINEERING (MDE) in Practice
Introduction to MDE
MDD with Executable UML Models
Enriching Tool Support for Model-Driven Software Development
Model-Driven Software Engineering in Practice - Chapter 4 - Model-Driven Arch...
Model-Driven Software Engineering in Practice - Chapter 10 - Managing models
Domain Driven Design
MDE=Model Driven Everything (Spanish Eclipse Day 2009)
ERP_Up_Down.ppt
Web technologies: Model Driven Engineering
The secret life of rules in Software Engineering
Abbott's Textual Analysis : Software Engineering 2
5 - Architetture Software - Metamodelling and the Model Driven Architecture
Oomd unit1
Software design with Domain-driven design
Modelado flexible basado en facetas
Facets_UCM
Overcoming The Impedance Mismatch Between Source Code And Architecture
Mda introduction and common research problems
Ad

Recently uploaded (20)

PDF
August Patch Tuesday
PDF
From MVP to Full-Scale Product A Startup’s Software Journey.pdf
PDF
Accuracy of neural networks in brain wave diagnosis of schizophrenia
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PPTX
Programs and apps: productivity, graphics, security and other tools
PPTX
Group 1 Presentation -Planning and Decision Making .pptx
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Getting Started with Data Integration: FME Form 101
PPTX
Tartificialntelligence_presentation.pptx
PDF
DP Operators-handbook-extract for the Mautical Institute
PDF
Microsoft Solutions Partner Drive Digital Transformation with D365.pdf
PDF
A comparative study of natural language inference in Swahili using monolingua...
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PPTX
cloud_computing_Infrastucture_as_cloud_p
PDF
A novel scalable deep ensemble learning framework for big data classification...
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PDF
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
PDF
Zenith AI: Advanced Artificial Intelligence
PPTX
SOPHOS-XG Firewall Administrator PPT.pptx
PDF
Approach and Philosophy of On baking technology
August Patch Tuesday
From MVP to Full-Scale Product A Startup’s Software Journey.pdf
Accuracy of neural networks in brain wave diagnosis of schizophrenia
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Programs and apps: productivity, graphics, security and other tools
Group 1 Presentation -Planning and Decision Making .pptx
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Getting Started with Data Integration: FME Form 101
Tartificialntelligence_presentation.pptx
DP Operators-handbook-extract for the Mautical Institute
Microsoft Solutions Partner Drive Digital Transformation with D365.pdf
A comparative study of natural language inference in Swahili using monolingua...
gpt5_lecture_notes_comprehensive_20250812015547.pdf
cloud_computing_Infrastucture_as_cloud_p
A novel scalable deep ensemble learning framework for big data classification...
NewMind AI Weekly Chronicles - August'25-Week II
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
Zenith AI: Advanced Artificial Intelligence
SOPHOS-XG Firewall Administrator PPT.pptx
Approach and Philosophy of On baking technology

MDE in Practice

  • 2. The $800-Million Bombshell (Motivation) • The following was the code for controlling long-distance phone traffic routing in USA: • … switch (caseIndex) { case‘A’: route = routeA; … break; … case‘M’: route = routeM; … case‘N’: route = routeN; … break; …} Missing “break” statement! When this code ran (in 1990), the entire US Northeast lost long-distance phone service
  • 3. Engineering Model A reduced representation of some system that highlights the properties of interest from a given viewpoint Functional ModelModeled system  We don’t see everything at once  We use a representation (notation) that is easily understood for the purpose on hand
  • 4. Models vs. Systems Differences due to: • Unique properties of actual construction materials • Construction methods • Scaling-up effects • Skill sets/technologies • Misunderstandings Can lead to serious errors and discrepancies in the realization
  • 5. Characteristics of Useful Models • Abstract • Emphasize important aspects while removing irrelevant ones • Understandable • Expressed in a form that is readily understood by observers • Accurate • Faithfully represents the modeled system • Predictive • Can be used to answer questions about the modeled system • Inexpensive • Much cheaper to construct and study than the modeled system To be useful, engineering models must satisfy all of these characteristics!
  • 6. ModelTransformations • Computation-independent Model • Uses natural language • Ex: state-chart diagram CIM • Platform-independent Model • Does not specify any technology PIM • Platform-specific Model • Built for a specific technology • When technology evolves, a new PSM can be generated rather than rewriting it PSM BusinessAnalyst Architect / Designer Developer /Tester
  • 7. Machine Code Impossible? TheAbstraction Gap • Middleware makes MDA a potential reality Level of Abstraction Generators 1 0..* security mortgages 1 0..* borrower mortgages 10..* ownerhouses House -value:Money Person -ssn:Integer -salary:Money +getMortgage(sum:Money,security:House):Mortgage Mortgage -principal:Money -monthlyPayment:Money -start:Date -end:Date Machine Code with Operating System Impractical?Use Operating System facilities Unlikely?Use Middleware Practical(ly) Middleware with Framework Today! AbstractionGap
  • 8. Model Execution X = cos (h + p/2) + x*5 X = cos (h + p/2) + x*5 ?  By formal analysis  mathematical methods  reliable (theoretically)  software is very difficult to model mathematically! ? X = cos (h + p/2) + x*5 X = cos (h + p/2) + x*5  By experimentation (execution)  more reliable than inspection  direct experience/insight X = cos (h + p/2) + x*5 X = cos (h + p/2) + x*5 ?  By inspection  mental execution  unreliable
  • 9. MDE Prospects • The problem: • We cannot keep implementing our applications using the programming technologies of the late Fifties’ • The demands on functionality, reliability, dependability, availability, security, and performance demanded of modern software. • We need to, can do, and have already done better! • MDE: • Increased levels of abstraction • Open unified standards • Increased levels of automation
  • 10. Primary Forms of Automation for MDE • Computer-based validation • Formal methods (qualitative and quantitative) • Computer-based testing • Automated test generation, setup, and execution • Computer-based model execution • Particularly execution of abstract and incomplete models -- when most of the important decisions are made • Model transformations • Code generation, between PSMs, …
  • 11. MDE - Case Study Project Description • A simple web-based J2EE e-commerce system (Pet Store) • Users can sign into a system and manage their accounts. • Users can browse a catalogue of pets on the web site (such as birds, fish or reptiles). • Shopping cart functionality: Users can add pets to their shopping cart and manage their shopping carts. • Order functionality: Users can place an order for the contents of their shopping carts. • Web services. Users can query orders via a web service.
  • 12. MDE - Case Study Teams Description • 2 development teams • Traditional development lifecycle • Model-driven Development style • 1 senior J2EE architect + 2 experienced J2EE programmers per team • Each team uses the same HTML, images and database schema. • MDA team was required to use an MDA tool • Traditional team was required to use leading J2EE IDE • Both teams must use EJB in their code bases • No further constraints
  • 13. Savings Achieved 0% 36% 46% 28% No data available Total average savings achieved: 26%
  • 14. Quantitative Results development hours spent by each team: Team Original Estimated Hours Actual Number of Hours Traditional team 499 507,5 MDA team 422 330 this corresponds to a 35% increase in productivity when using MDA
  • 15. QVT - Overview • QVT stands for Query/Views/Transformations • OMG standard language for expressing queries, views, and transformations on MOF models • Defines three model transformation languages. All of them operate on models which conform to MOF 2.0 meta-models
  • 16. QVT Transformation Languages • QVT-Operational Mappings • imperative language designed for writing unidirectional transformations • QVT-Relations • declarative language designed to permit both unidirectional and bidirectional model transformations • QVT-Core • declarative language designed to be simple and to act as the target of translation from QVT-Relations
  • 17. QVT Operational Structure QVT MMb Mb conformsTo conformsTo based on conformsTo conformsTo MOF MMa Ma conformsTo conformsTo conformsTo M1 M2 M3 Engine Tab based on input output executed
  • 18. Operational Mappings in Use • Case study: Flattening UML class hierarchies
  • 19. Flattening UML Class Hierarchies • Given a source UML model, transform it to another UML model in which only the leaf classes (classes not extended by other classes) in inheritance hierarchies are kept. Rules: • Transform only the leaf classes in the source model • Include the inherited attributes and associations • Attributes with the same name override the inherited attributes • Copy the primitive types
  • 20. Example Input Model name : String ssn : String Person school : String EnrolledInSchool organizationName : String Employed Student Employee «primitive type» String CarPhDStudent firstName : String lastName : String FullName name : FullName Professor carOwnership supervisor name : String Course street : String city : String Address residesAtattends
  • 21. Example Output Model «primitive type» String Carname : String ssn : String school : String PhDStudent firstName : String lastName : String FullName name : FullName ssn : String organizationName : String Professor carOwnership supervisor name : String Course street : String city : String Address residesAtattends residesAt
  • 22. ModelTransformation Expressed in Operational Mappings Language Overall structure of a transformation program: transformation SimpleUML2FlattenSimpleUML(in source : SimpleUML out target : SimpleUML); ………………………………………………………………… main() {} ………………………………………………………………… …helpers…………………………………………… …mapping operations……………… Signature: Declares the transformation name and the source and target metamodels. in and out keywords indicate source and target model variables. Entry point: The execution of the transformation starts here by executing the operations in the body of main Transformation elements: Transformation consists of mapping operations and helpers. They form the transformation logic.
  • 23. Mapping Operations • A mapping operation maps one or more source elements into one or more target elements • Always unidirectional • Selects source elements on the base of a type and a Boolean condition (guard) • Executes operations in its body to create target elements • May invoke other mapping operations and may be invoked • Mapping operations may be related by inheritance
  • 24. Mapping Operations: Example (1) • Consider the rule that transforms only leaf classes • Selects only classes without subclasses • Collects all the inherited properties • Creates new class in the target model mapping Class::leafClass2Class(in model : Model) : Class when {not model.allInstances(Generalization)->exists(g | g.general = self)} { name:= self.name; abstract:= self.abstract; attributes:= self.derivedAttributes()->map property2property(self)->asOrderedSet(); } Operation body Signature and guard name:= self.name; abstract:= self.abstract; attributes:= self.derivedAttributes()->map property2property(self)->asOrderedSet();
  • 25. Mapping Operations: Example (2) mapping Class::leafClass2Class(in model : Model) : Class when {not model.allInstances(Generalization)->exists(g | g.general = self)} Operation nameSource element type An optional sequence of input/output parameters Target element type Guard Operation Signature and Guard The Guard is an OCL expression used to filter source elements of a given type.The mapping operation is executed only on elements for which the guard expression is evaluated to true.
  • 26. name:= self.name; abstract:= self.abstract; attributes:= self.derivedAttributes()->map property2property(self)->asOrderedSet(); The predefined variable self refers to the source element on which the operation is executed The left-hand side of the assignments denotes properties of the target element Invocation of helper derivedAttributes The keyword map is used to invoke another mapping operation named property2property over the elements returned by the helper derivedAttributes Mapping Operations: Example (3) The mapping operation body contains initialization expressions for the properties of the target element.When an operation is executed over a source element the self variable is bound to it and an instance of the target type is created.Then the operation body is executed. Operation Body
  • 27. • Helpers are operations associated to a type that return a result • Both primitive and model types can be used • Helpers may be used to perform complex navigations over source models • Helpers have: • List of input parameters • An executable body Helpers
  • 28. Helpers Example query Class::derivedAttributes() : OrderedSet(Property){ if self.generalizations->isEmpty() then self.attributes else self.attributes->union( self.generalizations->collect(g | g.general.derivedAttributes()->select(attr | not self.attributes->exists(att | att.name = attr.name) ) )->flatten() )->asOrderedSet() endif } The context type of the helper derivedAttributes Result type
  • 29. Invoking Mapping Operations …………………………………………………… attributes:= self.derivedAttributes()->map property2property(self)->asOrderedSet(); …………………………………………………… mapping Property::property2property(in ownerClass : Class) : Property{ name:= self.name; type:= self.type; owner:= ownerClass; } Invocation of property2property on every member of the set returned by derivedAttributes query
  • 30. Constructs for Managing the Flow of Control • There are cases where more sophisticated control flow is needed. The following imperative constructs are available: • While • forEach • Break • Continue • If-then-else
  • 31. QVT Future Improvements • Tool support is still insufficient • Many issues need further exploration: • Performance; • Testing; • Scalability of transformations; • Ease of use; • Handling change propagation; • Reuse mechanisms.
  • 32. Thank you! Presented by: Anas Omar Basha Hussein Al-shukheir Abd Al-massih Yakeen Munir Kamal Hisham Alatrash