private phd defense_40-45min

132
Ambient-Oriented Dataflow Programming for Mobile RFID-Enabled Applications Andoni Lombide Carreton Promotor: Prof. Dr. Wolfgang De Meuter Copromotor: Prof. Dr. Theo D’Hondt Vrije Universiteit Brussel Brussels, Belgium Private PhD Defense, October 11th 2011, Brussels 1

Upload: alombide

Post on 25-May-2015

272 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Private phd defense_40-45min

Ambient-Oriented Dataflow Programming for Mobile RFID-Enabled Applications

Andoni Lombide Carreton

Promotor: Prof. Dr. Wolfgang De MeuterCopromotor: Prof. Dr. Theo D’Hondt Vrije Universiteit Brussel

Brussels, Belgium

Private PhD Defense, October 11th 2011, Brussels 1

Page 2: Private phd defense_40-45min

Roadmap

2

Part I: Mobile RFID-Enabled Applications

Part II: Ambient-Oriented Programming for Mobile RFID-Enabled Applications

Part III: Node-Centric Ambient-Oriented Dataflow Programming

Part IV: Network-Centric Ambient-Oriented Dataflow Programming

Part V: Conclusion

Page 3: Private phd defense_40-45min

Part I: Mobile RFID-Enabled Applications

3

Page 4: Private phd defense_40-45min

RFID Technology

0 cm ~ 10 m

0 Kb ~ 32 Kb

0.02$ ~ 0.50$

4

Page 5: Private phd defense_40-45min

Mobile RFID-Enabled Applications

5

Page 6: Private phd defense_40-45min

6

Page 7: Private phd defense_40-45min

6

Page 8: Private phd defense_40-45min

6

Page 9: Private phd defense_40-45min

7

Page 10: Private phd defense_40-45min

7

Page 11: Private phd defense_40-45min

7

Page 12: Private phd defense_40-45min

7

Page 13: Private phd defense_40-45min

Event-based Decoupling and Inversion of Control

(register-connection-callback (lambda (tagged-object)

...))

(register-reply-callback (lambda (reply) ...))

(register-disconnection-callback (lambda (tagged-object) ...))

8

Page 14: Private phd defense_40-45min

Event-based Decoupling and Inversion of Control

(register-connection-callback (lambda (tagged-object)

...))

(register-reply-callback (lambda (reply) ...))

(register-disconnection-callback (lambda (tagged-object) ...))

8

Page 15: Private phd defense_40-45min

Event-based Decoupling and Inversion of Control

(register-connection-callback (lambda (tagged-object) (set! ...) ...))

(register-reply-callback (lambda (reply) (set! ...) ...))

(register-disconnection-callback (lambda (tagged-object) (set! ...) ...))

Shared state

Shared state

Shared state

?

Shared state9

Page 16: Private phd defense_40-45min

Event-based Decoupling and Inversion of Control

(register-connection-callback (lambda (tagged-object) (set! ...) ...))

(register-reply-callback (lambda (reply) (set! ...) ...))

(register-disconnection-callback (lambda (tagged-object) (set! ...) ...))

Shared state

Shared state

Shared state

?

Shared state9

Page 17: Private phd defense_40-45min

Event-based Decoupling and Inversion of Control

(register-connection-callback (lambda (tagged-object) (set! ...) ...))

(register-reply-callback (lambda (reply) (set! ...) ...))

(register-disconnection-callback (lambda (tagged-object) (set! ...) ...))

Shared state

Shared state

Shared state

?

Shared state9

Page 18: Private phd defense_40-45min

Event-based Decoupling and Inversion of Control

(register-connection-callback (lambda (tagged-object) (set! ...) ...))

(register-reply-callback (lambda (reply) (set! ...) ...))

(register-disconnection-callback (lambda (tagged-object) (set! ...) ...))

Shared state

Shared state

Shared state

?

Shared state

Decoupling in space

Decoupling in time

Decoupling in arity

Rich representation of events

No inversion of control

Global control flow management9

Page 19: Private phd defense_40-45min

RFID-tagged Things as Objects

book.addReview(“Good book”);

println(book.getReviews());

10

Page 20: Private phd defense_40-45min

RFID-tagged Things as Objects

1. Addressing physical objects

2. Storing application-specific data on RFID tags

3. Reactivity to appearing and disappearing objects

4. Asynchronous, fault-tolerant communication

5. Data consistency

6. Infrastructureless operation

10

Page 21: Private phd defense_40-45min

RFID-tagged Things as Objects

1. Addressing physical objects

2. Storing application-specific data on RFID tags

3. Reactivity to appearing and disappearing objects

4. Asynchronous, fault-tolerant communication

5. Data consistency

6. Infrastructureless operation

10

Page 22: Private phd defense_40-45min

RFID-tagged Things as Objects

1. Addressing physical objects

2. Storing application-specific data on RFID tags

3. Reactivity to appearing and disappearing objects

4. Asynchronous, fault-tolerant communication

5. Data consistency

6. Infrastructureless operation

10

Page 23: Private phd defense_40-45min

RFID-tagged Things as Objects

1. Addressing physical objects

2. Storing application-specific data on RFID tags

3. Reactivity to appearing and disappearing objects

4. Asynchronous, fault-tolerant communication

5. Data consistency

6. Infrastructureless operation

10

Page 24: Private phd defense_40-45min

RFID-tagged Things as Objects

1. Addressing physical objects

2. Storing application-specific data on RFID tags

3. Reactivity to appearing and disappearing objects

4. Asynchronous, fault-tolerant communication

5. Data consistency

6. Infrastructureless operation

10

Page 25: Private phd defense_40-45min

RFID-tagged Things as Objects

1. Addressing physical objects

2. Storing application-specific data on RFID tags

3. Reactivity to appearing and disappearing objects

4. Asynchronous, fault-tolerant communication

5. Data consistency

6. Infrastructureless operation

10

Page 26: Private phd defense_40-45min

Survey of Related Work

Publish/subscribe systems

Reactive programming

Explicit dataflow programming

Node-centric sensor-network programming

Network-centric sensor-network programming 11

Page 27: Private phd defense_40-45min

Survey of Related Work

Publish/subscribe systems

Reactive programming

Explicit dataflow programming

Node-centric sensor-network programming

Network-centric sensor-network programming

Publish/subscribe + dataflow programming = ambient-oriented dataflow

11

Page 28: Private phd defense_40-45min

Part II: Ambient-Oriented Programming for Mobile RFID-Enabled Applications

12

Page 29: Private phd defense_40-45min

RFID in AmbientTalk

RFID event loop

Hardware Abstraction Layer

13

Page 30: Private phd defense_40-45min

RFID in AmbientTalk

RFID event loop

Hardware Abstraction Layer

13

Page 31: Private phd defense_40-45min

RFID in AmbientTalk

RFID event loop

Hardware Abstraction Layer

13

Page 32: Private phd defense_40-45min

RFID in AmbientTalk

RFID event loop

Hardware Abstraction Layer

13

Page 33: Private phd defense_40-45min

RFID in AmbientTalk

RFID event loop

Hardware Abstraction Layer

13

Page 34: Private phd defense_40-45min

RFID in AmbientTalk

RFID event loop

Hardware Abstraction Layer

13

Page 35: Private phd defense_40-45min

RFID in AmbientTalk

RFID event loop

Hardware Abstraction Layer

13

Page 36: Private phd defense_40-45min

RFID in AmbientTalk

RFID event loop

Hardware Abstraction Layer

13

Page 37: Private phd defense_40-45min

RFID in AmbientTalk

RFID event loop

Hardware Abstraction Layer

13

Page 38: Private phd defense_40-45min

Things: Proxies for Tags

deftype Book;

def aBook := thing: { def isbn := 123; def title := “My book”; def reviews := Vector.new();

def setTitle(newTitle)@Mutator { title := newTitle; };

def addReview(review)@Mutator { reviews.add(review); };} taggedAs: Book;

RFID event loop

Hardware Abstraction Layer

14

Page 39: Private phd defense_40-45min

Things: Proxies for Tags

deftype Book;

def aBook := thing: { def isbn := 123; def title := “My book”; def reviews := Vector.new();

def setTitle(newTitle)@Mutator { title := newTitle; };

def addReview(review)@Mutator { reviews.add(review); };} taggedAs: Book;

RFID event loop

Hardware Abstraction Layer

14

Page 40: Private phd defense_40-45min

Storing Objects on RFID Tags

def aBook := thing: { ... };

when: BlankTag discovered: { |tag| when: tag<-initialize(aBook) becomes: { |bookReference| // ... }}

RFID event loop

Hardware Abstraction Layer

tagaBook

15

Page 41: Private phd defense_40-45min

Storing Objects on RFID Tags

def aBook := thing: { ... };

when: BlankTag discovered: { |tag| when: tag<-initialize(aBook) becomes: { |bookReference| // ... }}

RFID event loop

Hardware Abstraction Layer

tagaBook

15

Page 42: Private phd defense_40-45min

Storing Objects on RFID Tags

def aBook := thing: { ... };

when: BlankTag discovered: { |tag| when: tag<-initialize(aBook) becomes: { |bookReference| // ... }}

RFID event loop

Hardware Abstraction Layer

tagaBook

15

Page 43: Private phd defense_40-45min

Storing Objects on RFID Tags

def aBook := thing: { ... };

when: BlankTag discovered: { |tag| when: tag<-initialize(aBook) becomes: { |bookReference| // ... }}

RFID event loop

Hardware Abstraction Layer

tag

bookReferenceaBook

15

Page 44: Private phd defense_40-45min

Reactivity to Appearing and Disappearing Things

RFID event loop

Hardware Abstraction Layer

whenever: Book discovered: { |book| // React on appearance whenever: book disconnected: { // React on disappearance }; whenever: book reconnected: { // React on reappearance };}; 16

Page 45: Private phd defense_40-45min

Reactivity to Appearing and Disappearing Things

RFID event loop

Hardware Abstraction Layer

whenever: Book discovered: { |book| // React on appearance whenever: book disconnected: { // React on disappearance }; whenever: book reconnected: { // React on reappearance };}; 16

Page 46: Private phd defense_40-45min

Reactivity to Appearing and Disappearing Things

RFID event loop

Hardware Abstraction Layer

whenever: Book discovered: { |book| // React on appearance whenever: book disconnected: { // React on disappearance }; whenever: book reconnected: { // React on reappearance };}; 16

Page 47: Private phd defense_40-45min

Reactivity to Appearing and Disappearing Things

RFID event loop

Hardware Abstraction Layer

whenever: Book discovered: { |book| // React on appearance whenever: book disconnected: { // React on disappearance }; whenever: book reconnected: { // React on reappearance };}; 16

Page 48: Private phd defense_40-45min

Asynchronous and Fault-tolerant Communication with Things

RFID event loop

Hardware Abstraction Layerwhen: book<-getTitle() becomes: { |title| system.println(“TITLE: “ + title) };system.println(“Here first!”);

17

Page 49: Private phd defense_40-45min

Asynchronous and Fault-tolerant Communication with Things

RFID event loop

Hardware Abstraction Layerwhen: book<-getTitle() becomes: { |title| system.println(“TITLE: “ + title) };system.println(“Here first!”);

17

Page 50: Private phd defense_40-45min

Asynchronous and Fault-tolerant Communication with Things

RFID event loop

Hardware Abstraction Layerwhen: book<-getTitle() becomes: { |title| system.println(“TITLE: “ + title) };system.println(“Here first!”);

17

Page 51: Private phd defense_40-45min

Asynchronous and Fault-tolerant Communication with Things

RFID event loop

Hardware Abstraction Layerwhen: book<-getTitle() becomes: { |title| system.println(“TITLE: “ + title) };system.println(“Here first!”);

17

Page 52: Private phd defense_40-45min

Asynchronous and Fault-tolerant Communication with Things

RFID event loop

Hardware Abstraction Layerwhen: book<-getTitle() becomes: { |title| system.println(“TITLE: “ + title) };system.println(“Here first!”);

17

Page 53: Private phd defense_40-45min

Asynchronous and Fault-tolerant Communication with Things

RFID event loop

Hardware Abstraction Layerwhen: book<-getTitle() becomes: { |title| system.println(“TITLE: “ + title) };system.println(“Here first!”);

17

Page 54: Private phd defense_40-45min

Asynchronous and Fault-tolerant Communication with Things

RFID event loop

Hardware Abstraction Layerwhen: book<-getTitle() becomes: { |title| system.println(“TITLE: “ + title) };system.println(“Here first!”);

17

Page 55: Private phd defense_40-45min

Benchmarks

18

Page 56: Private phd defense_40-45min

Benchmarks

18

Page 57: Private phd defense_40-45min

Summary

1. Addressing physical objects

2. Storing application-specific data on RFID tags

3. Reactivity to appearing and disappearing objects

4. Asynchronous, fault-tolerant communication

5. Data consistency

6. Infrastructureless operation

19

Page 58: Private phd defense_40-45min

Summary

1. Addressing physical objects

2. Storing application-specific data on RFID tags

3. Reactivity to appearing and disappearing objects

4. Asynchronous, fault-tolerant communication

5. Data consistency

6. Infrastructureless operation

19

Page 59: Private phd defense_40-45min

Part III: Node-Centric Ambient-Oriented Dataflow Programming

20

Page 60: Private phd defense_40-45min

The Ticket Trader Application

21

Page 61: Private phd defense_40-45min

The Ticket Trader Application

21

Event Signaling Reacting

New ticket trader connected

Automatic notification by AmbientTalk whenever:discovered:

Ticket trader disconnected

Automatic notification by AmbientTalk when:disconnected:

Ticket trader reconnected

Automatic notification by AmbientTalk

when:reconnected:

New ticket for sale notifyTicketForSale asynchronous message

notifyTicketForSale callback

Price of ticket changed

notifyPriceChanged asynchronous message

notifyPriceChanged callback

Location of ticket trader changed

notifyLocationChanged asynchronous message

notifyLocationChanged callback

Own location changed

GPS abstraction invokes callback with new coordinates

Callback registered on GPS abstraction

Page 62: Private phd defense_40-45min

Reactive Programming in AmbientTalk/R

GUI.centerOn(GPSLocation.latitude, GPSLocation.longitude);

.latitude .longitude

GUI.centerOn(_, _)

H

H+1

GPSLocation

latitude longitude

22

Page 63: Private phd defense_40-45min

Node-Centric Ambient-Oriented Dataflow Programming

subscribe( )

subscribe( )

publish( )

23

Page 64: Private phd defense_40-45min

Node-Centric Ambient-Oriented Dataflow Programming

subscribe( )

subscribe( )

publish( )

23

Page 65: Private phd defense_40-45min

Node-Centric Ambient-Oriented Dataflow Programming

subscribe( )

subscribe( )

publish( )

23

Page 66: Private phd defense_40-45min

Node-Centric Ambient-Oriented Dataflow Programming

subscribe( )

subscribe( )

publish( )

23

Page 67: Private phd defense_40-45min

Node-Centric Ambient-Oriented Dataflow Programming

subscribe( )

subscribe( )

publish( )

23

Page 68: Private phd defense_40-45min

Node-Centric Ambient-Oriented Dataflow Programming

subscribe( )

subscribe( )

publish( )

23

Page 69: Private phd defense_40-45min

Node-Centric Ambient-Oriented Dataflow Programming

subscribe( )

subscribe( )

publish( )

23

Page 70: Private phd defense_40-45min

Node-Centric Ambient-Oriented Dataflow Programming

subscribe( )

subscribe( )

publish( )

23

Page 71: Private phd defense_40-45min

Node-Centric Ambient-Oriented Dataflow Programming

subscribe( )

subscribe( )

publish( )

23

Page 72: Private phd defense_40-45min

Node-Centric Ambient-Oriented Dataflow Programming

subscribe( )

subscribe( )

publish( )

23

Page 73: Private phd defense_40-45min

Node-Centric Ambient-Oriented Dataflow Programming

subscribe( )

subscribe( )

publish( )

23

Page 74: Private phd defense_40-45min

Node-Centric Ambient-Oriented Dataflow Programming

subscribe( )

subscribe( )

publish( )

23

Page 75: Private phd defense_40-45min

Node-Centric Ambient-Oriented Dataflow Programming

subscribe( )

subscribe( )

publish( )

23

Page 76: Private phd defense_40-45min

Node-Centric Ambient-Oriented Dataflow Programming

subscribe( )

subscribe( )

publish( )

23

Page 77: Private phd defense_40-45min

Node-Centric Ambient-Oriented Dataflow Programming

subscribe( )

subscribe( )

publish( )

23

Page 78: Private phd defense_40-45min

Node-Centric Ambient-Oriented Dataflow Programming

subscribe( )

subscribe( )

publish( )

23

Page 79: Private phd defense_40-45min

Node-Centric Ambient-Oriented Dataflow Programming

subscribe( )

subscribe( )

publish( )

23

Page 80: Private phd defense_40-45min

Node-Centric Ambient-Oriented Dataflow Programming

subscribe( )

subscribe( )

publish( )

23

Page 81: Private phd defense_40-45min

Ambient Behaviorsdeftype TicketVendorLocation;

exportBehavior: GPSLocation as: TicketVendorLocation to: { |buyer| buyer.interestedIn == “Rock Werchter” };

deftype TicketVendorLocation;

def vendorLocation := ambientBehavior: TicketVendorLocation where: { def interestedIn := “Rock Werchter” } @Any;

GUI.showLocationOnMap(vendorLocation); 24

Page 82: Private phd defense_40-45min

Ambient Behaviorsdeftype TicketVendorLocation;

exportBehavior: GPSLocation as: TicketVendorLocation to: { |buyer| buyer.interestedIn == “Rock Werchter” };

deftype TicketVendorLocation;

def vendorLocation := ambientBehavior: TicketVendorLocation where: { def interestedIn := “Rock Werchter” } @Any;

GUI.showLocationOnMap(vendorLocation); 24

Page 83: Private phd defense_40-45min

Ambient Behaviorsdeftype TicketVendorLocation;

exportBehavior: GPSLocation as: TicketVendorLocation to: { |buyer| buyer.interestedIn == “Rock Werchter” };

deftype TicketVendorLocation;

def vendorLocation := ambientBehavior: TicketVendorLocation where: { def interestedIn := “Rock Werchter” } @Any;

GUI.showLocationOnMap(vendorLocation); 24

Page 84: Private phd defense_40-45min

Ambient Behaviorsdeftype TicketVendorLocation;

exportBehavior: GPSLocation as: TicketVendorLocation to: { |buyer| buyer.interestedIn == “Rock Werchter” };

deftype TicketVendorLocation;

def vendorLocation := ambientBehavior: TicketVendorLocation where: { def interestedIn := “Rock Werchter” } @Any;

GUI.showLocationOnMap(vendorLocation); 24

Page 85: Private phd defense_40-45min

Ambient Behaviorsdeftype TicketVendorLocation;

exportBehavior: GPSLocation as: TicketVendorLocation to: { |buyer| buyer.interestedIn == “Rock Werchter” };

deftype TicketVendorLocation;

def vendorLocation := ambientBehavior: TicketVendorLocation where: { def interestedIn := “Rock Werchter” } @Any;

GUI.showLocationOnMap(vendorLocation); 24

Page 86: Private phd defense_40-45min

Ambient Behaviorsdeftype TicketVendorLocation;

exportBehavior: GPSLocation as: TicketVendorLocation to: { |buyer| buyer.interestedIn == “Rock Werchter” };

deftype TicketVendorLocation;

def vendorLocations := ambientBehavior: TicketVendorLocation where: { def interestedIn := “Rock Werchter” } @All(3.seconds);

vendorLocations.each: { |loc| GUI.showLocationOnMap(loc) }; 24

Page 87: Private phd defense_40-45min

Ambient Behaviorsdeftype TicketVendorLocation;

exportBehavior: GPSLocation as: TicketVendorLocation to: { |buyer| buyer.interestedIn == “Rock Werchter” };

deftype TicketVendorLocation;

def vendorLocations := ambientBehavior: TicketVendorLocation where: { def interestedIn := “Rock Werchter” } @All(3.seconds);

vendorLocations.each: { |loc| GUI.showLocationOnMap(loc) }; 24

Page 88: Private phd defense_40-45min

Ambient Behaviorsdeftype TicketVendorLocation;

exportBehavior: GPSLocation as: TicketVendorLocation to: { |buyer| buyer.interestedIn == “Rock Werchter” };

deftype TicketVendorLocation;

def vendorLocations := ambientBehavior: TicketVendorLocation where: { def interestedIn := “Rock Werchter” } @All(3.seconds);

vendorLocations.each: { |loc| GUI.showLocationOnMap(loc) }; 24

Page 89: Private phd defense_40-45min

Ambient Behaviorsdeftype TicketVendorLocation;

exportBehavior: GPSLocation as: TicketVendorLocation to: { |buyer| buyer.interestedIn == “Rock Werchter” };

deftype TicketVendorLocation;

def vendorLocations := ambientBehavior: TicketVendorLocation where: { def interestedIn := “Rock Werchter” } @All(3.seconds);

vendorLocations.each: { |loc| GUI.showLocationOnMap(loc) }; 24

Page 90: Private phd defense_40-45min

Ambient Behaviorsdeftype TicketVendorLocation;

exportBehavior: GPSLocation as: TicketVendorLocation to: { |buyer| buyer.interestedIn == “Rock Werchter” };

deftype TicketVendorLocation;

def vendorLocations := ambientBehavior: TicketVendorLocation where: { def interestedIn := “Rock Werchter” } @All(3.seconds);

vendorLocations.each: { |loc| GUI.showLocationOnMap(loc) }; 24

Page 91: Private phd defense_40-45min

Reactive Queries

deftype TicketVendor;

export: ticketVendor as: TicketVendor with: { def event := “Rock Werchter” };

deftype TicketVendor;

def werchterVendors := ambient: TicketVendor where: { |vendor| vendor.event == “Rock Werchter” };

def locations := werchterVendors<-getLocation()@Refresh(3.seconds);

locations.each: { |loc| GUI.showLocationOnMap(loc) }; 25

Page 92: Private phd defense_40-45min

Reactive Queries

deftype TicketVendor;

export: ticketVendor as: TicketVendor with: { def event := “Rock Werchter” };

deftype TicketVendor;

def werchterVendors := ambient: TicketVendor where: { |vendor| vendor.event == “Rock Werchter” };

def locations := werchterVendors<-getLocation()@Refresh(3.seconds);

locations.each: { |loc| GUI.showLocationOnMap(loc) }; 25

Page 93: Private phd defense_40-45min

Reactive Queries

deftype TicketVendor;

export: ticketVendor as: TicketVendor with: { def event := “Rock Werchter” };

deftype TicketVendor;

def werchterVendors := ambient: TicketVendor where: { |vendor| vendor.event == “Rock Werchter” };

def locations := werchterVendors<-getLocation()@Refresh(3.seconds);

locations.each: { |loc| GUI.showLocationOnMap(loc) };

???

25

Page 94: Private phd defense_40-45min

Reactive Queries

deftype TicketVendor;

export: ticketVendor as: TicketVendor with: { def event := “Rock Werchter” };

deftype TicketVendor;

def werchterVendors := ambient: TicketVendor where: { |vendor| vendor.event == “Rock Werchter” };

def locations := werchterVendors<-getLocation()@Refresh(3.seconds);

locations.each: { |loc| GUI.showLocationOnMap(loc) };

? ? ?

25

Page 95: Private phd defense_40-45min

Reactive Queries

deftype TicketVendor;

export: ticketVendor as: TicketVendor with: { def event := “Rock Werchter” };

deftype TicketVendor;

def werchterVendors := ambient: TicketVendor where: { |vendor| vendor.event == “Rock Werchter” };

def locations := werchterVendors<-getLocation()@Refresh(3.seconds);

locations.each: { |loc| GUI.showLocationOnMap(loc) }; 25

Page 96: Private phd defense_40-45min

Reactive Queries

deftype TicketVendor;

export: ticketVendor as: TicketVendor with: { def event := “Rock Werchter” };

deftype TicketVendor;

def werchterVendors := ambient: TicketVendor where: { |vendor| vendor.event == “Rock Werchter” };

def locations := werchterVendors<-getLocation()@Refresh(3.seconds);

locations.each: { |loc| GUI.showLocationOnMap(loc) }; 25

Page 97: Private phd defense_40-45min

Reactive Queries

deftype TicketVendor;

export: ticketVendor as: TicketVendor with: { def event := “Rock Werchter” };

deftype TicketVendor;

def werchterVendors := ambient: TicketVendor where: { |vendor| vendor.event == “Rock Werchter” };

def locations := werchterVendors<-getLocation()@Refresh(3.seconds);

locations.each: { |loc| GUI.showLocationOnMap(loc) }; 25

Page 98: Private phd defense_40-45min

Reactive Queries

deftype TicketVendor;

export: ticketVendor as: TicketVendor with: { def event := “Rock Werchter” };

deftype TicketVendor;

def werchterVendors := ambient: TicketVendor where: { |vendor| vendor.event == “Rock Werchter” };

def locations := werchterVendors<-getLocation()@Refresh(3.seconds);

locations.each: { |loc| GUI.showLocationOnMap(loc) }; 25

Page 99: Private phd defense_40-45min

Quantitative Evaluation

26

Page 100: Private phd defense_40-45min

Quantitative Evaluation

26

Page 101: Private phd defense_40-45min

Quantitative Evaluation

26

Page 102: Private phd defense_40-45min

Qualitative Evaluation

27

Event Signaling Reacting

New ticket trader connected

Automatic notification by AmbientTalk whenever:discovered:

Ticket trader disconnected

Automatic notification by AmbientTalk when:disconnected:

Ticket trader reconnected

Automatic notification by AmbientTalk

when:reconnected:

New ticket for sale notifyTicketForSale asynchronous message

notifyTicketForSale callback

Price of ticket changed

notifyPriceChanged asynchronous message

notifyPriceChanged callback

Location of ticket trader changed

notifyLocationChanged asynchronous message

notifyLocationChanged callback

Own location changed

GPS abstraction invokes callback with new coordinates

Callback registered on GPS abstraction

Page 103: Private phd defense_40-45min

Qualitative Evaluation

27

Page 104: Private phd defense_40-45min

Qualitative Evaluation

27

Page 105: Private phd defense_40-45min

Qualitative Evaluation

27

Page 106: Private phd defense_40-45min

Qualitative Evaluation

27

Page 107: Private phd defense_40-45min

Qualitative Evaluation

27

Page 108: Private phd defense_40-45min

Qualitative Evaluation

27

def allNearbyOffers := ambientBehavior: TicketOffer @All(_timespan_);

allNearbyOffers.filter: { |offer| (offer.eventName == event).and: { (offer.price <= maxPrice).and: { GPSLocation.distanceTo(offer.location) <= maxDistance }}};

Page 109: Private phd defense_40-45min

Case Study: The Book Recommender Application in the Ambient Library

28

scannedrecommended

recommended in library

Page 110: Private phd defense_40-45min

Case Study: The Book Recommender Application in the Ambient Library

28

scannedrecommended

recommended in library

Page 111: Private phd defense_40-45min

Part IV: Network-Centric Ambient-Oriented Dataflow Programming

29

Page 112: Private phd defense_40-45min

Network-Centric Visual Dataflow Programming in AmbientTalk/RV

scannedrecommended

recommended in library

30

11

Page 113: Private phd defense_40-45min

Network-Centric Visual Dataflow Programming in AmbientTalk/RV

scannedrecommended

recommended in library

30

11BookRecommender ->

showBooks(books); showSimilarBooks(recommended); showRecommendationsInStock(recommendedInStock);

Shelf ->

deftype Book; def booksInstock := /.bridges.rfid.ReactiveRFIDService.scan(Book); similarBooks.filter: { |book| booksInStock.contains(book) };

recommendedInStock similarBooks

books

BookScanner ->

deftype Book; /.bridges.rfid.ReactiveRFIDService.scan(Book);

recommended

scannedBooks

EBookReader ->

scannedBooks.map: { |book| generateSimilarBooks(book) };

1

1

1

1

1

*

1

1

Page 114: Private phd defense_40-45min

Deploying an AmbientTalk/R Dataflow ProgramV

def BookRecommenderApp := extend: OperatorHostInterface with: { def showBooks(books) { ... }; def showSimilarBooks(books) { ... }; def showRecommendationsInStock(books) { ... };};

deftype BookRecommender;export: BookRecommenderApp as: BookRecommender;

AmbientTalk/R VM

JVM

31

BookRecommender ->

showBooks(books); showSimilarBooks(recommended); showRecommendationsInStock(recommendedInStock);

Page 115: Private phd defense_40-45min

Dataflow Dependencies

Rebinding dataflow dependency

Fixed dataflow dependency

32

BookScanner ->

deftype Book; /.bridges.rfid.ReactiveRFIDService.scan(Book);

1

1

BookRecommender ->

showBooks(books); showSimilarBooks(recommended); showRecommendationsInStock(recommendedInStock);

books

1

EBookReader ->

scannedBooks.map: { |book| generateSimilarBooks(book) };

Shelf ->

deftype Book; def booksInstock := /.bridges.rfid.ReactiveRFIDService.scan(Book); similarBooks.filter: { |book| booksInStock.contains(book) };

*

similarBooks

Page 116: Private phd defense_40-45min

Dependency Arities

33

1

BookRecommender ->

showBooks(books); showSimilarBooks(recommended); showRecommendationsInStock(recommendedInStock);

1

*

EBookReader ->

scannedBooks.map: { |book| generateSimilarBooks(book) };

1recommendedInStock similarBooks

Shelf ->

deftype Book; def booksInstock := /.bridges.rfid.ReactiveRFIDService.scan(Book); similarBooks.filter: { |book| booksInStock.contains(book) };

Page 117: Private phd defense_40-45min

Dependency Arities

33

*

BookRecommender ->

showBooks(books); showSimilarBooks(recommended); showRecommendationsInStock(recommendedInStock);

1

*

EBookReader ->

scannedBooks.map: { |book| generateSimilarBooks(book) };

1recommendedInStock similarBooks

Shelf ->

deftype Book; def booksInstock := /.bridges.rfid.ReactiveRFIDService.scan(Book); similarBooks.filter: { |book| booksInStock.contains(book) };

Page 118: Private phd defense_40-45min

Dependency Semantics

Incoming 1 Incoming *

Outgoing 1Signal one value to a

single (rebound or fixed) node

Signal one value to all reachable nodes of same

role

Outgoing *Signal set of values to a single (rebound or fixed)

node

Signal set of values to all reachable nodes of same

role

Binding semantics Arity semantics34

Page 119: Private phd defense_40-45min

Part V: Conclusion

35

Page 120: Private phd defense_40-45min

Limitations and Avenues for Future Research

• Event-loop based architecture prevents RFID events to be processed in parallel.

• Security was not considered. For RFID it requires revising the technology stack down to the hardware level.

• No distributed glitch prevention. It requires consistent distributed message ordering.

• AmbientTalk/R needs more tooling (e.g. visual scalability, syntax for content-based subscriptions...).

V

36

Page 121: Private phd defense_40-45min

Summarizing the Contributions

1. Addressing physical objects

2. Storing application-specific data on RFID tags

3. Reactivity to appearing and disappearing objects

4. Asynchronous, fault-tolerant communication

5. Data consistency

6. Infrastructureless operation

37

Page 122: Private phd defense_40-45min

Summarizing the Contributions

1. Addressing physical objects

2. Storing application-specific data on RFID tags

3. Reactivity to appearing and disappearing objects

4. Asynchronous, fault-tolerant communication

5. Data consistency

6. Infrastructureless operation

Ambi

ent-O

rient

ed P

rogr

amm

ing

with

Pas

sive

RFID

37

Page 123: Private phd defense_40-45min

Summarizing the Contributions

1. Addressing physical objects

2. Storing application-specific data on RFID tags

3. Reactivity to appearing and disappearing objects

4. Asynchronous, fault-tolerant communication

5. Data consistency

6. Infrastructureless operation

Ambi

ent-O

rient

ed P

rogr

amm

ing

with

Pas

sive

RFID

37

Decoupling in space

Decoupling in time

Decoupling in arity

Page 124: Private phd defense_40-45min

Summarizing the Contributions

1. Addressing physical objects

2. Storing application-specific data on RFID tags

3. Reactivity to appearing and disappearing objects

4. Asynchronous, fault-tolerant communication

5. Data consistency

6. Infrastructureless operation

No inversion of control

Ambi

ent-O

rient

ed P

rogr

amm

ing

with

Pas

sive

RFID

37

Decoupling in space

Decoupling in time

Decoupling in arity

Page 125: Private phd defense_40-45min

Summarizing the Contributions

1. Addressing physical objects

2. Storing application-specific data on RFID tags

3. Reactivity to appearing and disappearing objects

4. Asynchronous, fault-tolerant communication

5. Data consistency

6. Infrastructureless operation

No inversion of control

Ambi

ent-O

rient

ed P

rogr

amm

ing

with

Pas

sive

RFID

37

Decoupling in space

Decoupling in time

Decoupling in arity Publish/subscribe + dataflow programming = ambient-oriented dataflow

Page 126: Private phd defense_40-45min

Summarizing the Contributions

1. Addressing physical objects

2. Storing application-specific data on RFID tags

3. Reactivity to appearing and disappearing objects

4. Asynchronous, fault-tolerant communication

5. Data consistency

6. Infrastructureless operation

Ambi

ent-O

rient

ed P

rogr

amm

ing

with

Pas

sive

RFID

37

Decoupling in space

Decoupling in time

Decoupling in arity

Rich representation of events

No inversion of control

Page 127: Private phd defense_40-45min

Summarizing the Contributions

1. Addressing physical objects

2. Storing application-specific data on RFID tags

3. Reactivity to appearing and disappearing objects

4. Asynchronous, fault-tolerant communication

5. Data consistency

6. Infrastructureless operation

Ambi

ent-O

rient

ed P

rogr

amm

ing

with

Pas

sive

RFID

37

Global control flow management

Decoupling in space

Decoupling in time

Decoupling in arity

Rich representation of events

No inversion of control

Page 128: Private phd defense_40-45min

Summarizing the Contributions

1. Addressing physical objects

2. Storing application-specific data on RFID tags

3. Reactivity to appearing and disappearing objects

4. Asynchronous, fault-tolerant communication

5. Data consistency

6. Infrastructureless operation

Ambi

ent-O

rient

ed P

rogr

amm

ing

with

Pas

sive

RFID

37

Decoupling in space

Decoupling in time

Decoupling in arity

Rich representation of events

No inversion of control

Global control flow management

Page 129: Private phd defense_40-45min

Why Ambient-Oriented Language Abstractions?38

Page 130: Private phd defense_40-45min

Why Ambient-Oriented Language Abstractions?39

Page 131: Private phd defense_40-45min

Why Ambient-Oriented Language Abstractions?40

Page 132: Private phd defense_40-45min

Why Ambient-Oriented Language Abstractions?41