1 © Copyright MDE Systems 2008 Introduction to Model Driven Engineering using Eclipse Frameworks Bruce Trask Angel Roman MDE Systems Model Driven Development Generator Abstraction Refinement Model Driven Development
1© Copyright MDE Systems 2008
Introduction to Model Driven Engineering using Eclipse
Frameworks
Bruce Trask
Angel Roman
MDE Systems
Model
Driven
Development
Generator
Abstraction
Refinement
Model
Driven
Development
2© Copyright MDE Systems 2008
Agenda• Part I
– What is Model Driven Engineering
• Part II
– MDE, Eclipse in Action, Live Demo
– Questions and Answers
3© Copyright MDE Systems 2008
Warning
The live demo in this tutorial is real and contains
pictures of coding done without model driven
development. Some of the scenes you will see
may not be appropriate for children under the age
of 13
4© Copyright MDE Systems 2008
Summary
Model
Driven
Development
Generator
Abstraction
Refinement
Model
Driven
Development
5© Copyright MDE Systems 2008
Complexity and Change
6© Copyright MDE Systems 2008
Abstraction Gap
7© Copyright MDE Systems 2008
Software Engineering/Computer Science
• Raising the level of Abstraction
• Introducing layers of indirection to solve problems1
1 Dennis DeBruler, Refactoring, Fowler et. al. Addison Wesley 1999
8© Copyright MDE Systems 2008
Components
Frameworks
Middleware
Libraries
APIs
OS
HW
Language and Platform
Change
Complexity
TEAM
9© Copyright MDE Systems 2008
Components
Frameworks
Middleware
Libraries
APIs
OS
HW
Language and Platform – where we are now
Change
Complexity
TEAM
Cla
ssic
Pro
duct
Lin
e
Assets
10© Copyright MDE Systems 2008
Rote vs. Creative Code
11© Copyright MDE Systems 2008
Domain Specific vs. Domain Independent Code
12© Copyright MDE Systems 2008
Duplicate vs. Unique Code
13© Copyright MDE Systems 2008
What’s underneath the problems
• Language technology has not kept pace with platform technology1
• Insufficient linguistic power to tackle
platform and domain complexity
• Lack of tools to deal with increased complexity
1 Douglas C. Schmidt IEEE Computer Magazine February 2006
14© Copyright MDE Systems 2008
Solution
• Leverage recent critical innovations to provide a quantum leap of language technology and tools to overcome the
complexity gap
• Eclipse provides the necessary tools
to make this happen
15© Copyright MDE Systems 2008
Models - participants
16© Copyright MDE Systems 2008
Abstract(ion)• “Thought of as apart from concrete
realities, specific objects, or actual instances
• “Expressing a quality or characteristic apart from any specific object or instance”1
• Derivation: abs– away or away from, tract – to pull or draw1 – relate to domain/product
• “Doing more with less” [Unknown]
1Random House Unabridged Dictionary 2nd Edition, Random House 1993
17© Copyright MDE Systems 2008
Abstraction - Language
18© Copyright MDE Systems 2008
Groups of Abstractions
• Groups of abstractions are used to tackle complex problems
• Abstractions have particular relationships and can be combined in meaningful ways1
• New names, new relationships
• Creation of a vocabulary and grammar = language1
1Software Factories, Greenfield et. al. Wiley 2004
19© Copyright MDE Systems 2008
Abstraction
PackagingPatterns
Tools
Frameworks
Libraries
Pattern
Language
Components
Languages
ABSTRACTION
Traditional
Software Product
Line
Assets
MDD
Artifacts
20© Copyright MDE Systems 2008
Abstraction
Refinement Control
Productivity/Power
21© Copyright MDE Systems 2008
Model Driven Development• Program with Models
• Create Models that can be processed by a machined to produce lower level abstraction artifacts
• Language - Editor - Generator
22© Copyright MDE Systems 2008
Model Driven Development
The Anatomy and Pattern
23© Copyright MDE Systems 2008
24© Copyright MDE Systems 2008
Purpose
• Language– define the abstract syntax, or grammar, upon which
the editor, serialization concrete syntax, and in-memory concrete syntax are based.
• Editor– The purpose of the editor is to render, capture and
express design intent
• Generator– Provides automatic ways to get to lower levels of
more executable forms of code. – Provides the actual meaning or semantics to the
higher levels of abstractions.
25© Copyright MDE Systems 2008
26© Copyright MDE Systems 2008
27© Copyright MDE Systems 2008
Synonyms• Model Driven Development
• Domain Specific Language
28© Copyright MDE Systems 2008
Language
29© Copyright MDE Systems 2008
Language
Vocabulary
+ Grammar
= Language
30© Copyright MDE Systems 2008
Metamodel
Object oriented representation of
the grammar of a language
31© Copyright MDE Systems 2008
Sidebar
32© Copyright MDE Systems 2008
Non Software Example “Domain Independent”
33© Copyright MDE Systems 2008
Non Software Example
“Domain Specific”
34© Copyright MDE Systems 2008
Non Software Example
“Domain Specific”
35© Copyright MDE Systems 2008
Domain Specific Language
• Model concepts found in a specific domain
• Contrast to General Purpose Language –encodes generic abstractions
36© Copyright MDE Systems 2008
Editor
• Textual – Syntax and highlighting, intellisense
• Graphical – Domain Specific Graphics
• Meant for the human
• Nominated to a first class MDD participant
• Constraints at modeling time
• See the design
• Program in terms of domain
elements and relationships
• Declarative
37© Copyright MDE Systems 2008
Generator• Where the rubber meets the road in MDD
• Correct by construction
• Best Practice and Design Pattern replication
• Programming Power
• Maintainability – two sides of the same coin when bug occurs
• Portability of design
• Opens the world up to
new programmers
38© Copyright MDE Systems 2008
Framework
• Abstract architectures
and classes that
provide a partial
solution to a family of
problems.
39© Copyright MDE Systems 2008
DSLs, Models and Frameworks
40© Copyright MDE Systems 2008
Making it actually happen
41© Copyright MDE Systems 2008
Language Workbench1
Domain Model
Serializer
Observer
Reflection
Metamodel
Grammar
Model View
Controller
Command
Graphical
Framework
Chain of
Responsibility
Abstract
Factory
Factory
Method
State
Template
View Visitor Strategy
Serializer
http://www.martinfowler.com/articles/languageWorkbench.html
42© Copyright MDE Systems 2008
Language Workbench
Workbench
Modeling
Framework
Workbench
Generator
Framework
Workbench
Graphical
Editor
Framework
Workbench
Testing
Framework
Workbench
Graphical
Modeling
Framework
Workbench
Debugging
Framework
Workbench
Constraint
Framework
Workbench
Transformation
Framework
Language
Workbench
43© Copyright MDE Systems 2008
Eclipse1
http://www.martinfowler.com/articles/languageWorkbench.html
44© Copyright MDE Systems 2008
Eclipse – Language Workbench
45© Copyright MDE Systems 2008
Tasks
46© Copyright MDE Systems 2008
Workbench
Modeling
Framework
Workbench
Generator
Framework
Workbench
Graphical
Editor
Framework
Workbench
Testing
Framework
Workbench
Graphical
Modeling
Framework
Workbench
Debugging
Framework
Workbench
Constraint
Framework
Workbench
Transformation
Framework
Language
Workbench
Workbench
Textual
Modeling
Framework
Launch
Framework
JET
xPand
M2T
EMF
GEF
ATL
oAW
M2M
M2T
TMF
ELF
ETM
EVF
GMF
EDF
xUnit
TPTP
Frameworks and Projects
47© Copyright MDE Systems 2008
Eclipse as a Model Driven Development
EngineEclipse
Modeling
Framework
Java
Emitter
Templates
Graphical
Editor
Framework
Eclipse
Testing
Framework
Graphical
Modeling
Framework
Eclipse
Debugging
Framework
Eclipse
Constraint
Framework
Eclipse
Transformation
Framework
(ATL)
Domain
Specific
Graphics
Domain
Specific
Models
Domain
Specific
Generators
Domain
Specific
Debuggers
Domain
Specific
Graphics
Mapping
Domain
Specific
Constraints
Domain
Specific
Test
Domain
Specific
Transformations
48© Copyright MDE Systems 2008
Part 2
Model Driven Development, Software Product Lines
and Eclipse
in Action
Live Demo
49© Copyright MDE Systems 2008