Intelligent Code Generation for Model Driven Web Development
1. Firma convenzione
Politecnico di Milano e Veneranda Fabbrica
del Duomo di Milano
Aula Magna – Rettorato
Mercoledì 27 maggio 2015
Intelligent Code Generation for Model
Driven Web Development
Emanuele Falzone – Carlo Bernaschina
MATWEP 2018 | ICWE 2018 Workshop
Cáceres, June 5, 2018
2. Department of Electronics, Information and Bioengineering
Model Driven Development
General purpose and domain specific modelling language
3. Department of Electronics, Information and Bioengineering
Model Transformations (M2M)
Example: Place Chart Nets are used to describe the semantics of IFML
4. Department of Electronics, Information and Bioengineering
Model Transformations (M2T)
Example: source code is generated from IFML model
5. Department of Electronics, Information and Bioengineering
Model Transformations
What if the target meta-model has higher expressive power than
the source metamodel?
Exploitation Ambiguity
6. Department of Electronics, Information and Bioengineering
Exploitation
The transformation exploits the expressive power of the target meta-model to express in
higher detail the concepts defined in the source model. Non generatable models are not
useful to the purpose
7. Department of Electronics, Information and Bioengineering
Ambiguity
More then one valid target model is a possible
output candidate for the M2T transformation.
The model does not contain the information
required to generate fine grained styling details.
8. Department of Electronics, Information and Bioengineering
Forward Engineering
It requires unknown details to be solved by enhancing both meta-model and
transformations to remove uncertainties
9. Department of Electronics, Information and Bioengineering
Alternative approach
Relax the assumptions of Forward Engineering:
• enabling the manual introduction of details (e.g. styling) in
the generated code
• simplifying the resolution of conflicts between the
generated code and manual changes
11. Department of Electronics, Information and Bioengineering
VCS
The evolution of the project must be trackable using preexisting VCSs.
12. Department of Electronics, Information and Bioengineering
Notation
Code-base:
Ci denotes the version of the code-base edited by developer i.
CC identifies the central code-base shared among developers.
Revisions:
Rk
i,j denotes the jth revision of code-base Ci; it is the full textual
artifact stored in Ci at a particular point in time. K denotes the
type of the revision (M, G, R).
13. Department of Electronics, Information and Bioengineering
Workflow
Single developer working on the project.
14. Department of Electronics, Information and Bioengineering
Workflow
Two developers working on the same project.
15. Department of Electronics, Information and Bioengineering
The Virtual Developer
«The code generator can be treated as yet another developer,
who applies changes on an outdated repository.»
16. Department of Electronics, Information and Bioengineering
Workflow
Human developer and Virtual delevoper working on the same project.
17. Department of Electronics, Information and Bioengineering
Workflow
Human developer and Virtual delevoper working on the same project.
20. Department of Electronics, Information and Bioengineering
Project Structure
Split the code both locically and physically to improve software maintainabilty.
21. Department of Electronics, Information and Bioengineering
Coding Styles
White-spaces and new-lines, identifiers names, order invariant statements can lead to
really different appearance, which retain the same semantics.
22. Department of Electronics, Information and Bioengineering
Coding Styles
White-spaces and new-lines, identifiers names, order invariant statements can lead to
really different appearance, which retain the same semantics.
23. Department of Electronics, Information and Bioengineering
Conclusion
Approach for model and text co-evolution relaxes
the assumptions of Forward Engineering:
• enabling the manual introduction of details
(e.g. styling) in the generated code
• simplifying the resolution of conflicts between
the generated code and manual changes
https://play.google.com/store/apps/details?id=com.eu.funergy
24. Department of Electronics, Information and Bioengineering
Future work
Assessment of the proposed approach in the industry, with two
scenarios:
• companies that do not yet use MDD in their practices
• companies already applying in-house domain specific models
and code generation techniques
25. Department of Electronics, Information and Bioengineering
Q&A
Thank you for your attention
Questions?
Intelligent Code Generation for Model
Driven Web Development
Emanuele Falzone – Carlo Bernaschina
emanuele.falzone@mail.polimi.it | carlo.bernaschina@polimi.it