A Generative Programming Approach to Developing Pervasive Computing Systems

31
A Generative Programming Approach to Developing Pervasive Computing Systems Damien Cassou, Benjamin Bertran, Nicolas Loriant and Charles Consel GPCE'09

description

Presentation of the DiaSpec approach to GPCE 2009 in Denver.

Transcript of A Generative Programming Approach to Developing Pervasive Computing Systems

Page 1: A Generative Programming Approach to Developing Pervasive Computing Systems

A Generative Programming Approach to Developing Pervasive

Computing Systems

Damien Cassou, Benjamin Bertran, Nicolas Loriant and Charles Consel

GPCE'09

Page 2: A Generative Programming Approach to Developing Pervasive Computing Systems

2

Pervasive Computing Systems

Page 3: A Generative Programming Approach to Developing Pervasive Computing Systems

3

Page 4: A Generative Programming Approach to Developing Pervasive Computing Systems

4

hardware/software

functionalities

interfaces

Pervasive Computing

● heterogeneity● lack of structuring● dynamicity● multiple expertise● testing

Page 5: A Generative Programming Approach to Developing Pervasive Computing Systems

5

Pervasive Computing

● heterogeneity● lack of structuring● dynamicity● multiple expertise● testing

implicit interactions

no global reasoning

multi-roles components

Page 6: A Generative Programming Approach to Developing Pervasive Computing Systems

6

Pervasive Computing

● heterogeneity● lack of structuring● dynamicity● multiple expertise● testing

incremental deployment

mobility

entity malfunction

Page 7: A Generative Programming Approach to Developing Pervasive Computing Systems

7

Pervasive Computing

● heterogeneity● lack of structuring● dynamicity● multiple expertise● testing

hardware

network protocols

middleware

user needs

Page 8: A Generative Programming Approach to Developing Pervasive Computing Systems

8

Pervasive Computing

● heterogeneity● lack of structuring● dynamicity● multiple expertise● testing

time consuming

cost ineffective

limited situations

Page 9: A Generative Programming Approach to Developing Pervasive Computing Systems

9

Pervasive Computing

● heterogeneity● lack of structuring● dynamicity● multiple expertise● testing

● Existing approaches● general purpose● partial

Page 10: A Generative Programming Approach to Developing Pervasive Computing Systems

10

Our approach

Page 11: A Generative Programming Approach to Developing Pervasive Computing Systems

11

Our approach

Page 12: A Generative Programming Approach to Developing Pervasive Computing Systems

12

Fire managementscenario

Page 13: A Generative Programming Approach to Developing Pervasive Computing Systems

13

Page 14: A Generative Programming Approach to Developing Pervasive Computing Systems

14

DSL to describe a hierarchy of devices● attributes● data gathered● actions supported

1 Taxonomy

Page 15: A Generative Programming Approach to Developing Pervasive Computing Systems

15

1 Taxonomy

device SmokeDetector (Location loc){

source Smoke;

}

struct Smoke {

boolean isDetected;

}

Page 16: A Generative Programming Approach to Developing Pervasive Computing Systems

16

device Sprinkler (Location loc) {

action OnOff;

}

action OnOff {

on(); off();

}

1 Taxonomy

Page 17: A Generative Programming Approach to Developing Pervasive Computing Systems

17

Page 18: A Generative Programming Approach to Developing Pervasive Computing Systems

18

DSL to instantiate a commonpervasive computing architectural pattern

2 Architecture

Page 19: A Generative Programming Approach to Developing Pervasive Computing Systems

19

2 Architecture

Page 20: A Generative Programming Approach to Developing Pervasive Computing Systems

20

2 Architecture

context SmokeDetected: boolean { source Smoke from SmokeDetector;}

context FireState: boolean { context SmokeDetected; context AverageTemperature;}

Page 21: A Generative Programming Approach to Developing Pervasive Computing Systems

21

controller FireController {

context FireState;

action Activation on Alarm;

action OnOff on Sprinkler;

}

2 Architecture

Page 22: A Generative Programming Approach to Developing Pervasive Computing Systems

22

3 Generated programming framework

● generated from the description● dedicated to the application

in a GPL!

Page 23: A Generative Programming Approach to Developing Pervasive Computing Systems

23

3 Generated programming framework

● guides the implementation● abstracts the distributed back-end● provides high level support

in a GPL!

Page 24: A Generative Programming Approach to Developing Pervasive Computing Systems

24

3 Generated programming framework

...

Page 25: A Generative Programming Approach to Developing Pervasive Computing Systems

25

3 Generated programming framework

● interfaces● proxies● composites● support

➢ discovery➢ RPC

● and more

Page 26: A Generative Programming Approach to Developing Pervasive Computing Systems

26

4 Application development

guided by the descriptionthrough the generated framework

Page 27: A Generative Programming Approach to Developing Pervasive Computing Systems

27

4 Application development

class MyFireCtrl extends FireController { @Override void fireStateChanged(boolean fire, Location loc) { if (fire) { discover(sprinklersWhere()…).on(); … } … }}

controller FireController { context FireState; action OnOff on Sprinkler; …} architecture

framework

user code

device discovery remote procedure call

query language

Page 28: A Generative Programming Approach to Developing Pervasive Computing Systems

28

5 Generated simulation support

Page 29: A Generative Programming Approach to Developing Pervasive Computing Systems

29

5 Generated simulation supportEditor

Page 30: A Generative Programming Approach to Developing Pervasive Computing Systems

30

5 Generated simulation supportRuntime platform

no additional code!

Page 31: A Generative Programming Approach to Developing Pervasive Computing Systems

31

Conclusion & Future work● From a small description of a

pervasive computing system

● a generated programming framework

– to guide the development– to ensure conformance

● a support for graphical simulation

● a middleware abstraction layer

● Non-functional properties

● security

● fault tolerance

● Further leveraging on existing approaches/tools

● unit testing

● refactoring

● Generalizing our approach to other domains