Slide 1

Slide 1 text

jgs CSE 460 Software Design Lecture 34: Model-Driven Development Dr. Javier Gonzalez-Sanchez [email protected] javiergs.engineering.asu.edu | javiergs.com PERALTA 230U Office Hours: By appointment

Slide 2

Slide 2 text

Javier Gonzalez-Sanchez | CSE564 | Fall 2020 | 2 jgs Definition Model-driven software development (MDD) § Write and implement software quickly, effectively and at minimum cost. § The approach focuses on the construction of a software model. § The model (text or graphic) specifies how the software system should work before the code is generated. § The software is created automatically (translate the model to code) § Tested and then deployed.

Slide 3

Slide 3 text

Javier Gonzalez-Sanchez | CSE564 | Fall 2020 | 3 jgs MDD Development Process http://www.theenterprisearchitect.eu/blog/2009/08/05/a-metaphor-for-model-driven-engineering/

Slide 4

Slide 4 text

Javier Gonzalez-Sanchez | CSE564 | Fall 2020 | 4 jgs MDD Development Process

Slide 5

Slide 5 text

Javier Gonzalez-Sanchez | CSE564 | Fall 2020 | 5 jgs MDD Development Process

Slide 6

Slide 6 text

Javier Gonzalez-Sanchez | CSE564 | Fall 2020 | 6 jgs MDD Development Process

Slide 7

Slide 7 text

jgs 0. The Tool: Eclipse Modeling Framework

Slide 8

Slide 8 text

Javier Gonzalez-Sanchez | CSE564 | Fall 2020 | 9 jgs Eclipse § Eclipse is a universal platform for integrating development tools § Architecture based on plug-ins § SWT (Standard Widget Toolkit) is a generic graphics and GUI widget set § JFace is set of UI frameworks for common UI tasks § Workbench and Workspace are core – Editors, Views, and Perspectives

Slide 9

Slide 9 text

Javier Gonzalez-Sanchez | CSE564 | Fall 2020 | 10 jgs Eclipse Modeling Framework 2. Model specification (it is stored as XMI but defined as text or diagram). A subset of UML class diagrams semantics 1. EMF provides tools and runtime environment. 3. Translate to Java Classes and Interfaces

Slide 10

Slide 10 text

Javier Gonzalez-Sanchez | CSE564 | Fall 2020 | 11 jgs Download Eclipse Modeling Tools

Slide 11

Slide 11 text

Javier Gonzalez-Sanchez | CSE564 | Fall 2020 | 12 jgs Eclipse Modeling Tools

Slide 12

Slide 12 text

jgs 1. Define the Model

Slide 13

Slide 13 text

Javier Gonzalez-Sanchez | CSE564 | Fall 2020 | 14 jgs Model UML Class Diagram Description

Slide 14

Slide 14 text

Javier Gonzalez-Sanchez | CSE564 | Fall 2020 | 15 jgs Step 1 :: Project § Create an empty modeling project in your workspace File → New → Other… and choose Empty EMF Project § Click Next, enter a name for the project, e.g., org.eclipse.example.mymodel, and hit Finish

Slide 15

Slide 15 text

Javier Gonzalez-Sanchez | CSE564 | Fall 2020 | 16 jgs Step 2 :: Model § Please right click the model folder in your new modeling project then New → Other… → Ecore Model, then click Next and give the ecore file the name myModel.ecore. § It will open in the default Ecore editor, which allows the definition of Ecore models in a tree-based view

Slide 16

Slide 16 text

Javier Gonzalez-Sanchez | CSE564 | Fall 2020 | 17 jgs Step 2 :: Model :: Package § Give the package of your new model a name and an URI. This will be done in the properties view. The URI is used to identify the model later. Name the package myModel, Set the Ns Prefix to org.eclipse.example.myModel and the Ns URI to https://org/eclipse/example/myModel.

Slide 17

Slide 17 text

Javier Gonzalez-Sanchez | CSE564 | Fall 2020 | 18 jgs Step 2 :: Model :: Classes and Attributes § Define model elements as children of the root package by right clicking on the myModel package and on the EClass respectively Add EClass as children, New Child → EClass Add EAttribute as children, New Child → EAttribute

Slide 18

Slide 18 text

Javier Gonzalez-Sanchez | CSE564 | Fall 2020 | 19 jgs Step 2 :: Model :: Relationships § EReference between Course and Student, New Child → EReference EType of the reference to “Student” upper bound to “-1”, the equivalent of “many”. set the property Containment to “true”

Slide 19

Slide 19 text

Javier Gonzalez-Sanchez | CSE564 | Fall 2020 | 20 jgs Step 2 :: Model :: Relationships § EReference between Student and Computer, New Child → EReference EType of the reference to “Computer” upper bound to “1” (default) set the property Containment to “false” § Save all

Slide 20

Slide 20 text

jgs To be continued…

Slide 21

Slide 21 text

Javier Gonzalez-Sanchez | CSE564 | Fall 2020 | 22 jgs Reference § Eclipse Modeling Framework by Frank Budinsky § EMF project on eclipse.org

Slide 22

Slide 22 text

jgs CSE 564 Computer Systems Fundamentals Javier Gonzalez-Sanchez [email protected] Fall 2020 Disclaimer. These slides can only be used as study material for the class CSE564 at ASU. They cannot be distributed or used for another purpose.