What is a model
"Abstraction": A model reflects author's background and wishes.
It can not represent all aspects of reality.
It represents reality for the given purpose.
Why?
- Cost-effectiveness
- Cognitive purpose
It allows us to use something that is simpler, safer or cheaper than reality instead of reality for some purpose.
In a simplified manner, avoiding the complexity, danger and irreversibility of reality.
- Mapping feature: a model is based on an original system
- Reduction feature: a model only reflects selection of original's properties
- Pragmatic feature: a model needs to be usable in place of an original w.r.t. some purpose
What is Model Driven Engineering
MDE is not only for SE, it can also be used in: Enterprise engineering, business engineering, financial engineering, data engineering...
Shifting focus from code centric techniques to models.
Model Driven Software Engineering
Motivation: Model as drafts - as guidelines - as programs
Concepts
Abstraction from specific realization technologies
Automated code generation from abstract models
Separate development of application and infrastructure
MODELS+TRANSFORMATIONS=SOFTWARE
MD* Family
Model-driven development: use models as primary artifact of the development process
Model-driven architecture
Model-driven engineering: superset of MDD
Model-based engineering: softer version of MDE
Targets of MDSE
Problem domain: field or area of expertise that needs to be examined to solve a problem
Domain model: conceptual model of the problem domain
Technical spaces: working context for specification, implementation, and deployment of applications.
Modeling
Modeling Languages
Domain-specific languages: HTML, SQL, VHDL...
General purpose modeling languages: UML, Petri-nets, state machines...
Metamodeling
To represent the models themselves as instances of some more abstract models.
Metamodel = yet another abstraction, highlighting properties of the model itself.
Modelware is the MDSE paradigm similar to grammarware.
Relationship between models and meta model: conformance
Model Transformation
Defined at metamodel level, applied at model level
Transformations themselves can be seen as models.
Model Classification
Based on level of abstraction
- Describe requirements and needs - very abstract level
- Define the behavior of the system in terms of stored data
- Define all the technological aspect in detail
Static models: focus on static aspects of the system
Dynamic models: Emphasize the dynamic behavior of the system by showing the execution.
MDE Applications
Code Generation
Goal: Generating running code from higher level models
- Like compliers producing executable binary files from source code
- Also known as model compilers
Advantages
- Intellectual property
- Separation of modeling and execution
- Multi-platform generation
- Reuse of existing artifacts
- Better performances
Drawbacks
- Input models are not complete & code generator is not smart
- Programmers will need to complete the code manually
- Breaking the generation cycle is dangerous
- Generated code doesn't look familiar to developers.
Model Interpretation
A generic engine parses and executes the model on-the-fly using an interpretation approach.
Benefits
- Faster changes & transparent deployment
- Better portability
- Updates of the model at runtime
Danger of becoming dependent of the application vendor and if it disappears you cannot rely on the generated code.
Model Interoperability
MDSE techniques to bridge the interoperability gap.
The metamodel of the two systems are made explicit and aligned.
Transformations follow the alignment to move information
- Injectors (text2model) - syntactic transformation
- M2M transformation - semantic transformation
- Extractors (model2texts) - syntactic transformation
Model Driven Architecture
Four Principles of MDA
- Models must be expressed in a well-defined notation, so as to enable effective communication and understanding.
- Systems specifications must be organized around a set of models and associated transformations.
- Models must be compliant with metamodels.
- Increase acceptance, broad adoption and tool competition for MDE.
Modeling Levels of MDA
Computation independent CIM
Platform independent PIM
Platform-specific PSM