Ambient-oriented Programming & AmbientTalk



Similar documents
COM 440 Distributed Systems Project List Summary

Cid Santos Luis Matos. Introduction to AllJoyn

Napster and Gnutella: a Comparison of two Popular Peer-to-Peer Protocols. Anthony J. Howe Supervisor: Dr. Mantis Cheng University of Victoria

Flocks: Enabling Dynamic Group Interactions in Mobile Social Networking Applications

ANDROID PROGRAMMING - INTRODUCTION. Roberto Beraldi

Scala Actors Library. Robert Hilbrich

ELIXIR LOAD BALANCER 2

Handling Partial Failures in Mobile Ad hoc Network Applications: From Programming Language Design to Tool Support. Elisa González Boix

Android Fundamentals 1

Resilient Partitioning of Pervasive Computing Services

Software design (Cont.)

Division of Informatics, University of Edinburgh

Mobile Cloud Computing: Paradigms and Challenges 移 动 云 计 算 : 模 式 与 挑 战

Unity New Networking System (UNet) Unite Asia 2015

Fachbereich Informatik und Elektrotechnik SunSPOT. Ubiquitous Computing. Ubiquitous Computing, Helmut Dispert

Computer Networks Practicum 2015

Design Document. Offline Charging Server (Offline CS ) Version i -

Development of a new service using Wi-Fi Direct

Lecture 17: Mobile Computing Platforms: Android. Mythili Vutukuru CS 653 Spring 2014 March 24, Monday

UPnP Control Point for Mobile Phones in Residential Networks

ICC. NetLink Version Info INDUSTRIAL CONTROL COMMUNICATIONS, INC.

Handbook of Research on Mobile Software Engineering:

CHAPTER 1 INTRODUCTION

Using J-ISIS in a Local Network

Overview of CORBA 11.1 I NTRODUCTION TO CORBA Object services 11.5 New features in CORBA Summary

Last Class: OS and Computer Architecture. Last Class: OS and Computer Architecture

What can DDS do for You? Learn how dynamic publish-subscribe messaging can improve the flexibility and scalability of your applications.

Remote Desktop Access through Android Mobiles and Android Mobiles Access through Web Browser

Java in Web 2.0. Alexis Roos Principal Field Technologist, CTO Office OEM SW Sales Sun Microsystems, Inc.

Chapter 2: Remote Procedure Call (RPC)

Designing an NFS-based Mobile Distributed File System for Ephemeral Sharing in Proximity Networks

Middleware Lou Somers

IMPLEMENTATION OF AN AGENT MONITORING SYSTEM IN A JINI ENVIRONMENT WITH RESTRICTED USER ACCESS

Overview. Timeline Cloud Features and Technology

Using mobile phones to access Web Services in a secure way. Dan Marinescu

IST STREP Project. Deliverable D3.3.1u Middleware User s Guide Multi-Radio Device Management Layer.

Building Motion and Noise Detector Networks from Mobile Phones

Transparent Redirection of Network Sockets 1

What is NetOp Mobile?

Mobile Operating Systems. Week I

Why Threads Are A Bad Idea (for most purposes)

Improved Digital Media Delivery with Telestream HyperLaunch

Monitoring and control of users in open environments on the Android platform

Green Telnet. Making the Client/Server Model Green

How To Make A System Context Aware

How To Write A Network Operating System For A Network (Networking) System (Netware)

Testing Mobile Applications

This presentation covers virtual application shared services supplied with IBM Workload Deployer version 3.1.

Exhibit B5b South Dakota. Vendor Questions COTS Software Set

Connecting to Wireless networks and hotspots

Q3 USER GUIDE. Read Me to Get the Most Out of Your Device...

Fast remote data access for control of TCP/IP network using android Mobile device

AN APPLICATION OF INFORMATION RETRIEVAL IN P2P NETWORKS USING SOCKETS AND METADATA

ODROID Multithreading in Android

Using the Wireless Music Bridge

Ubiquitous access Inherently distributed Many, diverse clients (single purpose rich) Unlimited computation and data on demand

Real time vehicle tracking and driver behaviour monitoring using cellular handset based accelerometer and GPS data

Towards Peer-to-Peer Long-Lived Mobile Web Services

Application Note: AN00121 Using XMOS TCP/IP Library for UDP-based Networking

Studio 5.0 User s Guide

ACTOR-BASED MODEL FOR CONCURRENT PROGRAMMING. Sander Sõnajalg

Transparent Redirection of Network Sockets 1

Computer and Set of Robots

Special Note Ethernet Connection Problems and Handling Methods (CS203 / CS468 / CS469)

Adaptable Mobile Applications: Exploiting Logical Mobility in Mobile Computing

ANDROID APPLICATION DEVELOPER RESUME

PERFORMANCE COMPARISON OF COMMON OBJECT REQUEST BROKER ARCHITECTURE(CORBA) VS JAVA MESSAGING SERVICE(JMS) BY TEAM SCALABLE

Developing Applications for ios

Tuple spaces and Object spaces. Distributed Object Systems 12. Tuple spaces and Object spaces. Communication. Tuple space. Mechanisms 2.

Quick Connect. Overview. Client Instructions. LabTech

Disclaimer: The contents in this document are only my personal opinions, do not reflect the opinions of my employer or anyone else.

Chapter 3 Security and Firewall Protection

E-commerce: Competing the Advantages of a Mobile Enterprise

ANDROID PROGRAMMING - INTRODUCTION. Roberto Beraldi

About Firewall Protection

It is the thinnest layer in the OSI model. At the time the model was formulated, it was not clear that a session layer was needed.

TCP/IP Support Enhancements

User Guide. BlackBerry Storm 9530 Smartphone. Version: 4.7

Design Patterns in C++

Texas Instruments CC2540/41 Bluetooth Low Energy Sample Applications Guide v1.3.1

Introduction to Android

Advanced Computer Networks Project 2: File Transfer Application

SIMPLIFY MULTI-PLATFORM ENTERPRISE MOBILITY MANAGEMENT

FioranoMQ 9. High Availability Guide

PROFESSIONAL. Node.js BUILDING JAVASCRIPT-BASED SCALABLE SOFTWARE. Pedro Teixeira WILEY. John Wiley & Sons, Inc.

Jini Technology Applied to Railway Systems

Last Class: OS and Computer Architecture. Last Class: OS and Computer Architecture

Experimental Comparison of Hybrid and Native Applications for Mobile Systems

About This Guide Signature Manager Outlook Edition Overview... 5

An Oracle White Paper September Advanced Java Diagnostics and Monitoring Without Performance Overhead

How To Secure Cloud Computing

Android Geek Night. Application framework

Virtuozzo Virtualization SDK

HPC performance applications on Virtual Clusters

DSA-1000 / PRT-1000 Device Server / Thermal Printer

CSC 2405: Computer Systems II

Instructions for use the VPN at the Warsaw School of Economics

Lecture 7: Java RMI. CS178: Programming Parallel and Distributed Systems. February 14, 2001 Steven P. Reiss

Windows Operating Systems. Basic Security

Chapter 4 Firewall Protection and Content Filtering

Transcription:

Ambient-oriented Programming & AmbientTalk Tom Van Cutsem Stijn Mostinckx Elisa Gonzalez Boix Andoni Lombide Christophe Scholliers Wolfgang De Meuter Software Languages Lab Brussels, Belgium

Agenda 2 Context: Mobile & Ubiquitous computing Approach: Ambient-oriented programming Tool: AmbientTalk Experiments: Demo applications

Context Mobile & Ubiquitous Computing

Ubiquitous Computing 4 Research vision postulated by Mark Weiser (1988, Xerox PARC)

Today s Applications 5 Smart Homes/Domotics RFID Inventory Management Tourism/City Guide Software Personal Area Networks

Issues 6 Hardware Issues: Miniaturisation Device Autonomy Interoperability Processor Speed Limited Memory Integration Cost Software Issues: Context-awareness Interaction with real world Portability New user interfaces Standards Distributed Applications

Issues 6 Hardware Issues: Miniaturisation Device Autonomy Interoperability Processor Speed Limited Memory Integration Cost Software Issues: Context-awareness Interaction with real world Portability New user interfaces Standards Distributed Applications

Mobile Ad Hoc Networks 7 Networks composed of mobile devices that communicate wirelessly

Mobile Ad Hoc Networks 7 Networks composed of mobile devices that communicate wirelessly Zero Infrastructure

Mobile Ad Hoc Networks 7 Networks composed of mobile devices that communicate wirelessly Zero Infrastructure Volatile Connections

Approach Ambient-oriented Programming

Observation #1: interaction with proximate peers Example: match making between proximate peers 9 demand type = Concert Ticket ticket.artist = U2 ticket.location = * offer type = Concert Ticket ticket.artist = U2 ticket.location = Hyde Park

Observation #1: interaction with proximate peers Example: match making between proximate peers 9 demand offer type = Concert Ticket ticket.artist = U2 ticket.location = Hyde Park type = Concert Ticket ticket.artist = U2 ticket.location = *

Observation #1: interaction with proximate peers Example: match making between proximate peers 9 demand offer type = Concert Ticket ticket.artist = U2 ticket.location = Hyde Park type = Concert Ticket ticket.artist = U2 ticket.location = * No reliance on fixed, alwaysavailable server infrastructure

Observation #2: intermittent connectivity 10

Observation #2: intermittent connectivity 10

Observation #2: intermittent connectivity 10

Observation #2: intermittent connectivity 10 Tolerate disconnections, because they occur frequently rather than exceptionally

Software concerns 11 umama

Software concerns 11 umama Discovery

Software concerns 11 umama Discovery Communication

Software concerns 11 umama 32% 21% Discovery Communication Synchronisation

Software concerns 12 umama Discovery Communication Synchronisation

Software concerns 12 umama Discovery Communication Synchronisation Failure handling

Tool AmbientTalk

AmbientTalk: fact sheet 14 Object-oriented scripting language Started in 2005 Pure implementation Runs on J2ME/CDC phones Open source implementation code.google.com/p/ambienttalk

How does AmbientTalk help? 15 Volatile Connections network connections are resilient to failures by default Zero Infrastructure service discovery protocol built into the language

Object-oriented 16 def makesong(artist, title) { object: { def printartist() { if: (artist == nil) then: { unknown artist ; } else: { artist; } } } }

Object-oriented 16 def makesong(artist, title) { object: { def printartist() { if: (artist == nil) then: { unknown artist ; } else: { artist; } } } } def song := makesong( U2, One ); song.printartist();

Event Loop Concurrency 17 AmbientTalk programs are event loops They react to events from the outside world They communicate asynchronously Event Event Queue Event Loop Event Handler

Examples of event loops 18 GUI Frameworks (e.g. Java AWT) Highly interactive applications (e.g. games) IPC in Operating Systems Discrete Event Modelling (e.g. simulations) Web servers

Event Loop Concurrency in AmbientTalk 19

Event Loop Concurrency in AmbientTalk 19 Event Loop Message queue

Event Loop Concurrency in AmbientTalk 19 local object

Event Loop Concurrency in AmbientTalk 19 remote object

Event Loop Concurrency in AmbientTalk 20

Event Loop Concurrency in AmbientTalk 20 do m immediately obj obj.m()

Event Loop Concurrency in AmbientTalk 20 do m eventually obj<-m()

Event Loop Concurrency in AmbientTalk 20 do m eventually obj<-m()

Event Loop Concurrency in AmbientTalk 20? future

Event Loop Concurrency in AmbientTalk 20? future when: future becomes: { value // process reply }

Event Loop Concurrency in AmbientTalk 20? future when: future becomes: { value // process reply }

Exporting & discovering objects 21 mplayer

Exporting & discovering objects 21 mplayer deftype MusicPlayer deftype MusicPlayer

Exporting & discovering objects 21 mplayer deftype MusicPlayer deftype MusicPlayer export: mplayer as: MusicPlayer

Exporting & discovering objects 21 mplayer deftype MusicPlayer deftype MusicPlayer export: mplayer as: MusicPlayer whenever: MusicPlayer discovered: { mplayer // open a session }

Exporting & discovering objects 21 mplayer deftype MusicPlayer deftype MusicPlayer export: mplayer as: MusicPlayer whenever: MusicPlayer discovered: { mplayer // open a session }

Far References 22 uploadsong session

Far References 22 uploadsong session

Far References 22 uploadsong session

Far References 22 session

Far References 22 session

Far References 22 session

Far References 22 session when: session<-uploadsong(s)@due(timeout) becomes: { ack // continue exchange } catch: TimeoutException using: { e // stop exchange }

Leasing 23 lease: 10.minutes session disconnect Connected (messages are forwarded) expire reconnect Expired (messages are dropped) Disconnected (messages are buffered) expire

Reacting to failures 24 lease: 10.minutes session disconnect Connected (messages are forwarded) expire reconnect Expired (messages are dropped) Disconnected (messages are buffered) expire

Reacting to failures 24 lease: 10.minutes session disconnect when: session disconnected: { // pause transmission } Connected (messages are forwarded) expire reconnect Expired (messages are dropped) Disconnected (messages are buffered) expire

Reacting to failures 24 lease: 10.minutes session disconnect when: session disconnected: { // pause transmission } when: session reconnected: { // resume transmission } Connected (messages are forwarded) expire reconnect Expired (messages are dropped) Disconnected (messages are buffered) expire

Reacting to failures 24 lease: 10.minutes session disconnect when: session disconnected: { // pause transmission } when: session reconnected: { // resume transmission } Connected (messages are forwarded) expire reconnect Expired (messages are dropped) Disconnected (messages are buffered) expire when: session expired: { // stop transmission }

Reacting to failures 24 lease: 10.minutes session disconnect when: session disconnected: { // pause transmission } when: session reconnected: { // resume transmission } when: session expired: { // stop transmission } Connected (messages are forwarded) expire reconnect Expired (messages are dropped) Disconnected (messages are buffered) expire when: session expired: { // clean up resources }

Event Notifications 25 when: type discovered: { obj... } whenever: type discovered: { obj... } when: obj disconnected: {... } whenever: obj disconnected: {... } when: obj reconnected: {... } whenever: obj reconnected: {... } when: obj expired: {... } when: 5.minutes elapsed: {... } whenever: 5.minutes elapsed: {... } when: future becomes: { result... }

Event Notifications 25 Discovery when: type discovered: { obj... } whenever: type discovered: { obj... } when: obj disconnected: {... } whenever: obj disconnected: {... } when: obj reconnected: {... } whenever: obj reconnected: {... } when: obj expired: {... } when: 5.minutes elapsed: {... } whenever: 5.minutes elapsed: {... } when: future becomes: { result... }

Event Notifications 25 when: type discovered: { obj... } Failure Handling when: obj disconnected: {... } whenever: type discovered: { obj... } whenever: obj disconnected: {... } when: obj reconnected: {... } whenever: obj reconnected: {... } when: obj expired: {... } when: 5.minutes elapsed: {... } whenever: 5.minutes elapsed: {... } when: future becomes: { result... }

Event Notifications 25 when: type discovered: { obj... } whenever: type discovered: { obj... } when: obj disconnected: {... } whenever: obj disconnected: {... } when: obj reconnected: {... } whenever: obj reconnected: {... } when: obj expired: {... } Synchronisation when: 5.minutes elapsed: {... } whenever: 5.minutes elapsed: {... } when: future becomes: { result... }

Language Interoperability 26 AmbientTalk Program AmbientTalk VM Interop. Layer Java Virtual Machine Scripting language on top of the JVM, cfr. JRuby, Jython, Groovy,... AmbientTalk can use Java libraries, Java can use AmbientTalk scripts

Batteries Included 27 def Button := jlobby.java.awt.button; def button := Button.new( Click Me ); button.addactionlistener(object: { def actionperformed(actionevent) { println( button clicked ); } }); button.setvisible(true);

Reflection 28 AmbientTalk code can introspect and change behavior of objects and actors def makesong(artist, title) { object: { def printartist() { if: (artist == nil) then: { unknown artist ; } else: { artist; } } } } def song := makesong( U2, One ); song.printartist();

Reflection 28 AmbientTalk code can introspect and change behavior of objects and actors def makesong(artist, title) { object: { def printartist() { if: (artist == nil) then: { unknown artist ; } else: { artist; } } } } def mirroronsong := (reflect: song); mirroronsong.invoke(song, createinvocation(`printartist, [])); mirroronsong.listslots(); mirroronsong.addslot(slot);... def song := makesong( U2, One ); song.printartist();

Implementation 29 Interactive interpreter ± 17.000 SLOC of UDP & TCP/IP over WLAN Runs on top of J2ME/CDC QTek 9090 SmartPhones HTC Touch Cruise SmartPhones iphone [in progress] Android G1 [in progress]

Experiments Demo Applications

Case: Musical Match Maker 31 Demo

Experimental Results 32

Experimental Results 33

Causes 34 Explicit encoding of buffered, asynchronous communication using threads remote messages using objects timeouts using timer threads event notifications (lease expiration & renewal, calls & callbacks) using listeners + event loop threads Java RMI does not deal with service discovery

Case: Instant Messenger 35 Demo

Chat: Java vs AmbientTalk (LoC) 36

Chat: Java vs AmbientTalk (%) 37

A simple application but... 38... we do not need to explicitly manage: threads & locks low-level socket connections stubs, skeletons name server or lookup service timeouts, leasing

AmbientMorphic 39 Implementation of the Morphic UI framework from Self Demo: PortalPong

Conclusion 40 Mobile ad hoc networks: Ambient-oriented programming: AmbientTalk: Scripting language on top of the JVM Reactive, event-driven programs Applications: chat, match maker, multiplayer game

Conclusion 40 Mobile ad hoc networks: Zero Infrastructure Volatile Connections Ambient-oriented programming: AmbientTalk: Scripting language on top of the JVM Reactive, event-driven programs Applications: chat, match maker, multiplayer game

Conclusion 40 Mobile ad hoc networks: Zero Infrastructure Volatile Connections Ambient-oriented programming: Peer-to-peer Tolerate disconnections AmbientTalk: Scripting language on top of the JVM Reactive, event-driven programs Applications: chat, match maker, multiplayer game

Don t program the hardware of the future with the software of the past http://prog.vub.ac.be/amop