Top Banner
1 Adding Spreadsheets to the MDE Toolbox Martin Francis, D. Kolovos, N. Matragkas, R. Paige Department of Computer Science University of York
39
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Adding Spreadsheets to the MDE Toolbox

1

Adding Spreadsheets to the MDE Toolbox

Martin Francis, D. Kolovos,

N. Matragkas, R. Paige Department of Computer Science

University of York

Page 2: Adding Spreadsheets to the MDE Toolbox

2 MDE

• Aims to improve the quality and efficiency of the software development process

– Promotes models to first-class citizens

– Reduces the need for human compilers

• Not restricted to a particular modelling technology / model representation format

Skip Ad>

Page 3: Adding Spreadsheets to the MDE Toolbox

3 Models in MDE

• Structured artefacts that

– Contain (meta-)information of interest related to the system under development

– Are amenable to automated processing

• Transformation

• Validation

• Simulation etc.

Page 4: Adding Spreadsheets to the MDE Toolbox

4 Artefacts of Interest

EMF

XML XSD

Spreadsheets

Visio RDBMS

Page 5: Adding Spreadsheets to the MDE Toolbox

5 The MDE Community

EMF

XML XSD

Spreadsheets

Visio RDBMS

Page 6: Adding Spreadsheets to the MDE Toolbox

6 Everyone else

EMF

XML XSD

Spreadsheets

Visio RDBMS

Page 7: Adding Spreadsheets to the MDE Toolbox

7 Spreadsheets

• Versatile and intuitive

• Fill in gaps in the software development process

– When no specialised tools exist for the job

– When specialised tools are too

expensive/complicated

– When information needs to be collected

from non-programmers

Page 8: Adding Spreadsheets to the MDE Toolbox

8 Spreadsheets

• Used for

– Capturing requirements

– Tracking bugs

– Allocating roles

– Monitoring tasks

• ... but have been largely ignored by MDE languages and tools

Page 9: Adding Spreadsheets to the MDE Toolbox

9 Aim of this Work

• Add support for (Google) spreadsheets to languages for – Model querying

– Model-to-model transformation

– Model validation

– Model-to-text transformation

– Model comparison

– Model merging

• ... so that spreadsheets can be used in any step of an MDE process

Page 10: Adding Spreadsheets to the MDE Toolbox

10 eclipse.org/Epsilon

Page 11: Adding Spreadsheets to the MDE Toolbox

11 Concept Mapping

• Spreadsheet -> Model

• Worksheet -> Type

• Column -> Property

• Row -> Model element

modules

MSD,HCI

F

MSD,RQE

E

mt506supervisor

mt506

4 jd5023 SmithJane 22jd501 232 ThompsonJoe

D age

C lastname

Bfirstname

Aid

1

Student Staff

E

dj5123 JacksonDaniel HCImt506 MSD,RQE2 ThomasMatthew

D teaches

C lastname

Bfirstname

Aid

1

Student Staff

Module

Module

Student Staff ModuleHuman Computer Interaction Spring 4 HCI

D

RQE3 SpringRequirements EngineeringMSD2 AutumnModelling and System Design

C term

Btitle

Aid

1

Mark

Mark

Mark

E

jd5023 74ICAR jd5012 62TPOP

D C mark

Bmodule

Astudent

1

Student Staff Module Mark

Page 12: Adding Spreadsheets to the MDE Toolbox

12 Preview (Query)

modules

MSD,HCI

F

MSD,RQE

E

mt506supervisor

mt506

4 jd5023 SmithJane 22jd501 232 ThompsonJoe

D age

C lastname

Bfirstname

Aid

1

Student Staff

E

dj5123 JacksonDaniel HCImt506 MSD,RQE2 ThomasMatthew

D teaches

C lastname

Bfirstname

Aid

1

Student Staff

Module

Module

Student Staff ModuleHuman Computer Interaction Spring 4 HCI

D

RQE3 SpringRequirements EngineeringMSD2 AutumnModelling and System Design

C term

Btitle

Aid

1

Mark

Mark

Mark

E

jd5023 74ICAR jd5012 62TPOP

D C mark

Bmodule

Astudent

1

Student Staff Module Mark

Student.allInstances->

select(s | s.age >= 18).println();

Page 13: Adding Spreadsheets to the MDE Toolbox

13 Preview (Query)

modules

MSD,HCI

F

MSD,RQE

E

mt506supervisor

mt506

4 jd5023 SmithJane 22jd501 232 ThompsonJoe

D age

C lastname

Bfirstname

Aid

1

Student Staff

E

dj5123 JacksonDaniel HCImt506 MSD,RQE2 ThomasMatthew

D teaches

C lastname

Bfirstname

Aid

1

Student Staff

Module

Module

Student Staff ModuleHuman Computer Interaction Spring 4 HCI

D

RQE3 SpringRequirements EngineeringMSD2 AutumnModelling and System Design

C term

Btitle

Aid

1

Mark

Mark

Mark

E

jd5023 74ICAR jd5012 62TPOP

D C mark

Bmodule

Astudent

1

Student Staff Module Mark

Student.all.

select(s | s.age >= 18).println();

Page 14: Adding Spreadsheets to the MDE Toolbox

14 Preview (Query)

modules

MSD,HCI

F

MSD,RQE

E

mt506supervisor

mt506

4 jd5023 SmithJane 22jd501 232 ThompsonJoe

D age

C lastname

Bfirstname

Aid

1

Student Staff

E

dj5123 JacksonDaniel HCImt506 MSD,RQE2 ThomasMatthew

D teaches

C lastname

Bfirstname

Aid

1

Student Staff

Module

Module

Student Staff ModuleHuman Computer Interaction Spring 4 HCI

D

RQE3 SpringRequirements EngineeringMSD2 AutumnModelling and System Design

C term

Btitle

Aid

1

Mark

Mark

Mark

E

jd5023 74ICAR jd5012 62TPOP

D C mark

Bmodule

Astudent

1

Student Staff Module Mark

for (s in Student.all) {

if (s.age >= 18) {

s.println();

}

}

Page 15: Adding Spreadsheets to the MDE Toolbox

15 Preview (M2T)

modules

MSD,HCI

F

MSD,RQE

E

mt506supervisor

mt506

4 jd5023 SmithJane 22jd501 232 ThompsonJoe

D age

C lastname

Bfirstname

Aid

1

Student Staff

E

dj5123 JacksonDaniel HCImt506 MSD,RQE2 ThomasMatthew

D teaches

C lastname

Bfirstname

Aid

1

Student Staff

Module

Module

Student Staff ModuleHuman Computer Interaction Spring 4 HCI

D

RQE3 SpringRequirements EngineeringMSD2 AutumnModelling and System Design

C term

Btitle

Aid

1

Mark

Mark

Mark

E

jd5023 74ICAR jd5012 62TPOP

D C mark

Bmodule

Astudent

1

Student Staff Module Mark

<ul>

[%for (s in Student.allInstances){%]

<li> [%=s.firstname] [%=s.lastname]

[%}%]

</ul>

Page 16: Adding Spreadsheets to the MDE Toolbox

16 Preview (Validation)

context Mark {

constraint WithinRange {

check: self.mark <= 100 and

self.mark >= 0

message: “Mark ” + self.mark +

“ must be between 0-100”

}

}

modules

MSD,HCI

F

MSD,RQE

E

mt506supervisor

mt506

4 jd5023 SmithJane 22jd501 232 ThompsonJoe

D age

C lastname

Bfirstname

Aid

1

Student Staff

E

dj5123 JacksonDaniel HCImt506 MSD,RQE2 ThomasMatthew

D teaches

C lastname

Bfirstname

Aid

1

Student Staff

Module

Module

Student Staff ModuleHuman Computer Interaction Spring 4 HCI

D

RQE3 SpringRequirements EngineeringMSD2 AutumnModelling and System Design

C term

Btitle

Aid

1

Mark

Mark

Mark

E

jd5023 74ICAR jd5012 62TPOP

D C mark

Bmodule

Astudent

1

Student Staff Module Mark

Page 17: Adding Spreadsheets to the MDE Toolbox

17 Concept Mapping

• Spreadsheet -> Model

• Worksheet -> Type

• Column -> Property

• Row -> Model element

modules

MSD,HCI

F

MSD,RQE

E

mt506supervisor

mt506

4 jd5023 SmithJane 22jd501 232 ThompsonJoe

D age

C lastname

Bfirstname

Aid

1

Student Staff

E

dj5123 JacksonDaniel HCImt506 MSD,RQE2 ThomasMatthew

D teaches

C lastname

Bfirstname

Aid

1

Student Staff

Module

Module

Student Staff ModuleHuman Computer Interaction Spring 4 HCI

D

RQE3 SpringRequirements EngineeringMSD2 AutumnModelling and System Design

C term

Btitle

Aid

1

Mark

Mark

Mark

E

jd5023 74ICAR jd5012 62TPOP

D C mark

Bmodule

Astudent

1

Student Staff Module Mark

Page 18: Adding Spreadsheets to the MDE Toolbox

18 Limitations

• No way to specify

– Column data types

– Cross-references between columns

– Multiplicities

modules

MSD,HCI

F

MSD,RQE

E

mt506supervisor

mt506

4 jd5023 SmithJane 22jd501 232 ThompsonJoe

D age

C lastname

Bfirstname

Aid

1

Student Staff

E

dj5123 JacksonDaniel HCImt506 MSD,RQE2 ThomasMatthew

D teaches

C lastname

Bfirstname

Aid

1

Student Staff

Module

Module

Student Staff ModuleHuman Computer Interaction Spring 4 HCI

D

RQE3 SpringRequirements EngineeringMSD2 AutumnModelling and System Design

C term

Btitle

Aid

1

Mark

Mark

Mark

E

jd5023 74ICAR jd5012 62TPOP

D C mark

Bmodule

Astudent

1

Student Staff Module Mark

Page 19: Adding Spreadsheets to the MDE Toolbox

19 Limitations

• No way to work with

– Title-less columns

– Worksheets with bizarre names (“Tom’s

Data”)

modules

MSD,HCI

F

MSD,RQE

E

mt506supervisor

mt506

4 jd5023 SmithJane 22jd501 232 ThompsonJoe

D age

C lastname

Bfirstname

Aid

1

Student Staff

E

dj5123 JacksonDaniel HCImt506 MSD,RQE2 ThomasMatthew

D teaches

C lastname

Bfirstname

Aid

1

Student Staff

Module

Module

Student Staff ModuleHuman Computer Interaction Spring 4 HCI

D

RQE3 SpringRequirements EngineeringMSD2 AutumnModelling and System Design

C term

Btitle

Aid

1

Mark

Mark

Mark

E

jd5023 74ICAR jd5012 62TPOP

D C mark

Bmodule

Astudent

1

Student Staff Module Mark

Page 20: Adding Spreadsheets to the MDE Toolbox

20 Configuration Metamodel

Spreadsheet

Worksheetname : Stringalias : String

Columnindex : Integername : Stringalias : StringdataType : Stringmany : booleandelimiter : String

Referencename : Stringmany : booleancascadeUpdates : boolean

sourcetarget

columns

worksheets

Page 21: Adding Spreadsheets to the MDE Toolbox

21 Data Types

<spreadsheet>

<worksheet name=“Student”>

<column name=“age” type=“Integer”/>

</worksheet>

</spreadsheet>

modules

MSD,HCI

F

MSD,RQE

E

mt506supervisor

mt506

4 jd5023 SmithJane 22jd501 232 ThompsonJoe

D age

C lastname

Bfirstname

Aid

1

Student Staff

E

dj5123 JacksonDaniel HCImt506 MSD,RQE2 ThomasMatthew

D teaches

C lastname

Bfirstname

Aid

1

Student Staff

Module

Module

Student Staff ModuleHuman Computer Interaction Spring 4 HCI

D

RQE3 SpringRequirements EngineeringMSD2 AutumnModelling and System Design

C term

Btitle

Aid

1

Mark

Mark

Mark

E

jd5023 74ICAR jd5012 62TPOP

D C mark

Bmodule

Astudent

1

Student Staff Module Mark

Page 22: Adding Spreadsheets to the MDE Toolbox

22 Data Types

Student.allInstances->

select(s | s.age >= 18)

modules

MSD,HCI

F

MSD,RQE

E

mt506supervisor

mt506

4 jd5023 SmithJane 22jd501 232 ThompsonJoe

D age

C lastname

Bfirstname

Aid

1

Student Staff

E

dj5123 JacksonDaniel HCImt506 MSD,RQE2 ThomasMatthew

D teaches

C lastname

Bfirstname

Aid

1

Student Staff

Module

Module

Student Staff ModuleHuman Computer Interaction Spring 4 HCI

D

RQE3 SpringRequirements EngineeringMSD2 AutumnModelling and System Design

C term

Btitle

Aid

1

Mark

Mark

Mark

E

jd5023 74ICAR jd5012 62TPOP

D C mark

Bmodule

Astudent

1

Student Staff Module Mark

Page 23: Adding Spreadsheets to the MDE Toolbox

23 References

<spreadsheet>

<reference source=“Mark->module”

target=“Module->id”

many=“false”/>

</spreadsheet>

modules

MSD,HCI

F

MSD,RQE

E

mt506supervisor

mt506

4 jd5023 SmithJane 22jd501 232 ThompsonJoe

D age

C lastname

Bfirstname

Aid

1

Student Staff

E

dj5123 JacksonDaniel HCImt506 MSD,RQE2 ThomasMatthew

D teaches

C lastname

Bfirstname

Aid

1

Student Staff

Module

Module

Student Staff ModuleHuman Computer Interaction Spring 4 HCI

D

RQE3 SpringRequirements EngineeringMSD2 AutumnModelling and System Design

C term

Btitle

Aid

1

Mark

Mark

Mark

E

jd5023 74ICAR jd5012 62TPOP

D C mark

Bmodule

Astudent

1

Student Staff Module Mark

Page 24: Adding Spreadsheets to the MDE Toolbox

24 References

Mark.allInstances

->select(m | m.mark < 40)

->collect(m | m.module.title)

->asSet();

modules

MSD,HCI

F

MSD,RQE

E

mt506supervisor

mt506

4 jd5023 SmithJane 22jd501 232 ThompsonJoe

D age

C lastname

Bfirstname

Aid

1

Student Staff

E

dj5123 JacksonDaniel HCImt506 MSD,RQE2 ThomasMatthew

D teaches

C lastname

Bfirstname

Aid

1

Student Staff

Module

Module

Student Staff ModuleHuman Computer Interaction Spring 4 HCI

D

RQE3 SpringRequirements EngineeringMSD2 AutumnModelling and System Design

C term

Btitle

Aid

1

Mark

Mark

Mark

E

jd5023 74ICAR jd5012 62TPOP

D C mark

Bmodule

Astudent

1

Student Staff Module Mark

Page 25: Adding Spreadsheets to the MDE Toolbox

25

Implementation

Page 26: Adding Spreadsheets to the MDE Toolbox

26 eclipse.org/Epsilon

Page 27: Adding Spreadsheets to the MDE Toolbox

28 Option #1

Page 28: Adding Spreadsheets to the MDE Toolbox

29 Problems

• Injection of large spreadsheets can be slow

• Propagating changes back to the spreadsheet can be challenging

• Loss of native querying capabilities

Page 29: Adding Spreadsheets to the MDE Toolbox

30 Option #2

• Develop a native spreadsheets driver for Epsilon’s pluggable type system (EMC)

• Pros

– No intermediate artefacts

– No stale data

– Direct updates to the spreadsheet

– Can leverage native querying capabilities

Page 30: Adding Spreadsheets to the MDE Toolbox

31

Page 31: Adding Spreadsheets to the MDE Toolbox

32 Query Translation

• Exploit the built-in querying capabilities of Google Spreadsheets

• Example

– Find all students who have a mark higher

than 70 in some module

modules

MSD,HCI

F

MSD,RQE

E

mt506supervisor

mt506

4 jd5023 SmithJane 22jd501 232 ThompsonJoe

D age

C lastname

Bfirstname

Aid

1

Student Staff

E

dj5123 JacksonDaniel HCImt506 MSD,RQE2 ThomasMatthew

D teaches

C lastname

Bfirstname

Aid

1

Student Staff

Module

Module

Student Staff ModuleHuman Computer Interaction Spring 4 HCI

D

RQE3 SpringRequirements EngineeringMSD2 AutumnModelling and System Design

C term

Btitle

Aid

1

Mark

Mark

Mark

E

jd5023 74ICAR jd5012 62TPOP

D C mark

Bmodule

Astudent

1

Student Staff Module Mark

Page 32: Adding Spreadsheets to the MDE Toolbox

33 Using select()

Mark.allInstances

->select(m | m.mark > 70);

modules

MSD,HCI

F

MSD,RQE

E

mt506supervisor

mt506

4 jd5023 SmithJane 22jd501 232 ThompsonJoe

D age

C lastname

Bfirstname

Aid

1

Student Staff

E

dj5123 JacksonDaniel HCImt506 MSD,RQE2 ThomasMatthew

D teaches

C lastname

Bfirstname

Aid

1

Student Staff

Module

Module

Student Staff ModuleHuman Computer Interaction Spring 4 HCI

D

RQE3 SpringRequirements EngineeringMSD2 AutumnModelling and System Design

C term

Btitle

Aid

1

Mark

Mark

Mark

E

jd5023 74ICAR jd5012 62TPOP

D C mark

Bmodule

Astudent

1

Student Staff Module Mark

Page 33: Adding Spreadsheets to the MDE Toolbox

34 Using find()

S.find(m:Mark | m.mark > 70);

modules

MSD,HCI

F

MSD,RQE

E

mt506supervisor

mt506

4 jd5023 SmithJane 22jd501 232 ThompsonJoe

D age

C lastname

Bfirstname

Aid

1

Student Staff

E

dj5123 JacksonDaniel HCImt506 MSD,RQE2 ThomasMatthew

D teaches

C lastname

Bfirstname

Aid

1

Student Staff

Module

Module

Student Staff ModuleHuman Computer Interaction Spring 4 HCI

D

RQE3 SpringRequirements EngineeringMSD2 AutumnModelling and System Design

C term

Btitle

Aid

1

Mark

Mark

Mark

E

jd5023 74ICAR jd5012 62TPOP

D C mark

Bmodule

Astudent

1

Student Staff Module Mark

Page 35: Adding Spreadsheets to the MDE Toolbox

36

Page 36: Adding Spreadsheets to the MDE Toolbox

37 Moving to EMF

Mark.allInstances

->select(m | m.mark < 40)

->collect(m | m.module.title)

->asSet();

modules

MSD,HCI

F

MSD,RQE

E

mt506supervisor

mt506

4 jd5023 SmithJane 22jd501 232 ThompsonJoe

D age

C lastname

Bfirstname

Aid

1

Student Staff

E

dj5123 JacksonDaniel HCImt506 MSD,RQE2 ThomasMatthew

D teaches

C lastname

Bfirstname

Aid

1

Student Staff

Module

Module

Student Staff ModuleHuman Computer Interaction Spring 4 HCI

D

RQE3 SpringRequirements EngineeringMSD2 AutumnModelling and System Design

C term

Btitle

Aid

1

Mark

Mark

Mark

E

jd5023 74ICAR jd5012 62TPOP

D C mark

Bmodule

Astudent

1

Student Staff Module Mark

Page 37: Adding Spreadsheets to the MDE Toolbox

38 Moving to EMF

Mark.allInstances

->select(m | m.mark < 40)

->collect(m | m.module.title)

->asSet();

Page 38: Adding Spreadsheets to the MDE Toolbox

39 code.google.com/p/Epsilonlabs

Page 39: Adding Spreadsheets to the MDE Toolbox

40 Take-home Message

• We need to reach out to mainstream developers and embrace the types of models they are using – or risk becoming irrelevant