adding spreadsheets to the mde toolbox

39
1 Adding Spreadsheets to the MDE Toolbox Martin Francis, D. Kolovos, N. Matragkas, R. Paige Department of Computer Science University of York

Upload: dimitris-kolovos

Post on 13-Jul-2015

666 views

Category:

Technology


2 download

TRANSCRIPT

1

Adding Spreadsheets to the MDE Toolbox

Martin Francis, D. Kolovos,

N. Matragkas, R. Paige Department of Computer Science

University of York

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>

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.

4 Artefacts of Interest

EMF

XML XSD

Spreadsheets

Visio RDBMS

5 The MDE Community

EMF

XML XSD

Spreadsheets

Visio RDBMS

6 Everyone else

EMF

XML XSD

Spreadsheets

Visio RDBMS

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

8 Spreadsheets

• Used for

– Capturing requirements

– Tracking bugs

– Allocating roles

– Monitoring tasks

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

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

10 eclipse.org/Epsilon

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

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();

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();

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();

}

}

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>

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

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

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

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

20 Configuration Metamodel

Spreadsheet

Worksheetname : Stringalias : String

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

Referencename : Stringmany : booleancascadeUpdates : boolean

sourcetarget

columns

worksheets

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

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

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

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

25

Implementation

26 eclipse.org/Epsilon

28 Option #1

29 Problems

• Injection of large spreadsheets can be slow

• Propagating changes back to the spreadsheet can be challenging

• Loss of native querying capabilities

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

31

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

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

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

36

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

38 Moving to EMF

Mark.allInstances

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

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

->asSet();

39 code.google.com/p/Epsilonlabs

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