call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
Introduction to architectures based on models, models and metamodels. model driven architecture
1. Software Architecture
School of Computer Science University of Oviedo
University of Oviedo
Software Architecture
Part III
Class #1
Introduction to Architectures based
on Models, Models and Metamodels.
Model-Driven Architecture
2014 Vicente García Díaz
5. Software Architecture
School of Computer Science University of Oviedo
Formula 1
car
(domain)
What is a model? (I)
Model
describes
6. Software Architecture
School of Computer Science University of Oviedo
6
What is a model? (II)
1. Point of reference to imitate or reproduce
2. Element, that, for its perfection must be
followed and reproduced
3. Small representation of something
4. It is a theoretical scheme, usually
mathematical, of a system or of a complex
reality, as the economic development of a
country, which is made to facilitate the
understanding and the study of its behavior
Source: http://www.rae.es/rae.html
7. Software Architecture
School of Computer Science University of Oviedo
• Of course…
7
Models in software development?
Model Development Product
8. Software Architecture
School of Computer Science University of Oviedo
• Classical engineering is based on the use of
models to produce a product after conducting
a development
▫ Is not possible to fully automate the
development
8
Typical development process
9. Software Architecture
School of Computer Science University of Oviedo
• Peculiarity: software products can be
designed and created without “going out" of
the computer
• Informatics Information + Automatic
9
Software development process
Model Development Product
10. Software Architecture
School of Computer Science University of Oviedo
Could we automate the software
development process?
Model-Driven Engineering
(MDE)
10
11. Software Architecture
School of Computer Science University of Oviedo
11
Motivation
• Growth of software complexity
• It is not being reused the technological and domain
knowledge
• It is necessary to industrialize software development
• The term software crisis is still valid
The major cause of the software crisis is
that the machines have become several
orders of magnitude more powerful! To
put it quite bluntly: as long as there were
no machines, programming was no
problem at all; when we had a few weak
computers, programming became a mild
problem, and now we have gigantic
computers, programming has become an
equally gigantic problem [Dijkstra, 1972]
[Standish Group, 2004]
12. Software Architecture
School of Computer Science University of Oviedo
• The level of abstraction of languages is
growing
▫ Binary
▫ Assembly
▫ Procedural
▫ Object oriented
• Towards the solution space of the problem
• In the 80s CASE tools emerge
▫ They did not have much success
12
Brief History (I)
+ number of errors in the development
+ level of abstraction
14. Software Architecture
School of Computer Science University of Oviedo
Goals (I)
• Reduce the complexity of current platforms
14
• Express the concepts of different domains in a more
approximate way
Domain concepts
Domain concepts
Mental work of developers
Concepts of the
technology used
Concepts of the
technology used
15. Software Architecture
School of Computer Science University of Oviedo
• Abstract the specification of systems from the
implementation in the target platform
• Improve portability, interoperability and
reusability
• Optimize productivity
15
Goals (II)
16. Software Architecture
School of Computer Science University of Oviedo
For what is mainly used MDE?
• To create software models
16
• Such models define the concepts of a particular
domain
• Existing technologies encompassed in MDE allowed
to work with the models as if they were
programming languages of high-level
abstraction
▫ Usually domain-specific languages
18. Software Architecture
School of Computer Science University of Oviedo
Mobile applications
Source: http://www.metacase.com/support/45/manuals/S60%20Phone%20Example.pdf
19. Software Architecture
School of Computer Science University of Oviedo
Insurance Products
Source: [Kelly and Tolvanen, 2008]
20. Software Architecture
School of Computer Science University of Oviedo
IP telephony
Source: [Kelly and Tolvanen, 2008]
21. Software Architecture
School of Computer Science University of Oviedo
Digital watches
Source: [Kelly and Tolvanen, 2008]
22. Software Architecture
School of Computer Science University of Oviedo
Home automation
Source: [Kelly and Tolvanen, 2008]
26. Software Architecture
School of Computer Science University of Oviedo
Others
Fuente: http://www.pleus.net/articles/boodsl/boodsl.htm
http://sandervanderburg.blogspot.com.es/2011/05/deployment-abstractions-for-webdsl.html
http://mpov.timmorgan.org/cascadingrubies-ruby-dsl-for-generating-css/
28. Software Architecture
School of Computer Science University of Oviedo
• Cascading relationship between models and
metamodels
28
The metamodel
Elements of
the real
world
(domain)
describe describe
Model Metamodel
29. Software Architecture
School of Computer Science University of Oviedo
29
Conceptual space
Meta-metamodel
<<instanceof>>
Domain Metamodel
Abstract
syntax
Semantics
Concrete
syntax
Domain-specific
language
Formal
model
Describe
concepts of
<<instanceof>>
Based on
Respects
Sub-domains
31. Software Architecture
School of Computer Science University of Oviedo
31
The domain of Petri Nets
• They were defined in the 60's by Carl Adam Petri
• They are a specialization of automata theory which allows to
express concurrent events
• They have places, transitions and arcs
• Application areas: data analysis, software design, reliability,
workflows ...
P1
P2
T1
T2
15
4
17
3 4 6
P3 P1 P5
P4
32. Software Architecture
School of Computer Science University of Oviedo
32
A metamodel for the domain
Node
+Name : string
Arc
+weight : int
Place Transition
PetriNet
1
0..*
1
0..*
P1
P2
T1
T2
15
4
17
3 4 6
P3 P1 P5
33. Software Architecture
School of Computer Science University of Oviedo
33
A meta-meta model for the domain
Model Element
Generalizable Element
Typed Element
Attribute Association Class
Node
+Name : string
Arc
+weight : int
Place Transition
PetriNet
1
0..*
1
0..*
34. Software Architecture
School of Computer Science University of Oviedo
34
Mapping between concrete and
abstract syntaxes
Node
+Name : string
Arc
+weight : int
T1
15 17
Place Transition
PetriNet
1 0..*
1
0..*
P1 P2
35. Software Architecture
School of Computer Science University of Oviedo
Metamodel (abstract syntax)
• A metamodel defines the elements of a modeling language,
the relationships among them and constraints
CompositeState
Event
StateMachine
0..n
0..1
Transition
0..1
+trigger
State
0..n
0..n
0..1 0..n
0..n
+transitions
0..1
1
+top
37. Software Architecture
School of Computer Science University of Oviedo
Concrete syntax (textual)
State machine: an example of a state machine
State: state1
State: state2
State: state3
Transition: state1 – state2
Transition: state1 – state3
Transition: state2 – state3
39. Software Architecture
School of Computer Science University of Oviedo
Concrete syntax (textual)
table Country do
field name, varchar(100),primary_key
field area, integer
end
table Person do
field id, autoinc, primary_key
field name, varchar(200)
field id_country, varchar(100), foreign_key(:Country)
end
40. Software Architecture
School of Computer Science University of Oviedo
• Key in model-driven engineering
• It is imperative to:
1. Build domain-specific languages
2. Validate models
3. Transform models
4. Generate artifacts (code, documentation,
etc.)
5. Integration of tools
40
Benefits of the use of a metamodel
42. Software Architecture
School of Computer Science University of Oviedo
• Defined by the Object Management Group OMG, approach whereby the
system design is geared towards models
• OMG Object Management Group 1989
▫ International consortium of the software industry
▫ Composed of many organizations, IBM, Eclipse Foundation, W3C,
Microsoft, HP, etc.
▫ Definition of standards
• http://www.omg.org/mda
42
Introduction to MDA
43. Software Architecture
School of Computer Science University of Oviedo
• Computation Independent Model
(CIM)
• Platform Independent Model (PIM)
• Platform Specific Model (PSM)
• Implementation Specific Model (ISM)
43
Points of view
CIM
PIM
PSM 1 PSM n
…
ISM 1 ISM n
…
44. Software Architecture
School of Computer Science University of Oviedo
Vertical transformations
PIM
Transformation
PSM
J2EE
Transformation
ISM
Java
Definition of automatic
transformation 1
Definition of automatic
transformation 2
45. Software Architecture
School of Computer Science University of Oviedo
45
Four-layer architecture
MOF
UML SysML
UML models SysMLmodels
…
…
System
Meta-metamodel
(M3)
Metamodel (M2)
Model (M1)
Reality (M0)
46. Software Architecture
School of Computer Science University of Oviedo
Standards of the OMG
• UML (Unified Model Language)
• MOF (Meta Object Facility)
• XMI (XML Metadata Interchange)
• OCL (Object Constraint Language)
• QVT (Query View Transformation)
• There are others…
47. Software Architecture
School of Computer Science University of Oviedo
Meta-Object Facility (MOF) ECORE
• Ecore
ECORE META-METAMODEL
49. Software Architecture
School of Computer Science University of Oviedo
Introduction to Architectures based on
Models, Models and Metamodels.
Model-Driven Architecture
Thank you
El metamodelado (o meta-metamodelo) es uno de los temas más importantes de MDE. ES LA BASE. Se necesita para todo:
-Para definir la sintaxis abstracta de los lenguajes en función de un meta-metamodelo origen
-Para definir la sintaxis concreta de los lenguajes en función de un meta-metamodelo origen
Los modelos (equivalente a los programas que se hacen con Java, por ejemplo) pueden ser validados en base a las restricciones puestas en el metamodelo (que a su vez se basan en el meta-metamodelo origen)
Se pueden realizar transformaciones de modelos en base a reglas de transformación entre los metamodelos
Generar código, artefactos en base a las reglas de las plantillas de transformación
Como todos los lenguajes se basan en un mismo meta-metamodelo, entonces se consigue que las herramientas se integren entre sí.