Developing Ambient Intelligence (AmI) software is a non-trivial task. This is because, not only do we need to deal with many of the known issues of distributed systems, e.g., inherent concurrency and network latency, but also we face the fundamental problem of connection volatility. As ambient devices frequently come in and out of range with each other, connections will be constantly established and broken. Connection volatility is therefore a fundamental problem of AmI: whereas in non-AmI programs connections are assumed to be permanent, in AmI the inverse is the norm.

Developing applications that behave correctly in the presence of connection volatility is a difficult task. An important reason for this is that the code for this concern is scattered throughout the application, and tangled with the core functionality of the application. Furthermore no abstraction mechanisms have yet been developed that provide an adequate amount of support for connection volatility. Spoon Graffiti is an implementation of the concept of tagged futures, which we propose as a valid abstraction mechanism for connection volatility in AmI applications. Tagged futures allow the specification of the offline behavior of the application in a straightforward and non-tangled manner. Furthermore, our proposal includes support to semi-automatically transition from an online to an offline state, and vice-versa. Again this support is provided at a higher level of abstraction and is not tangled with the core application code.

A number of abstraction mechanisms have previously been developed for connection volatility however none of these provide adequate support for specifying offline behavior of the application. One such abstraction is the use of futures. We can use futures as empty place-holders for return values of network operations. Futures have the important advantage that they do not introduce any tangling of the connection volatility concern in the application. Their downside is however that in a disconnected setting they only allow an application to continue working in a very limited fashion. It is our opinion that these limits are too strict. We therefore propose to enrich futures, to allow them to be more amply useful. Tagged futures allow metadata, i.e., tags, to be attached to them. This metadata can then specify an mock value to be used during disconnected operations. The use of such metadata makes futures applicable in a more realistic setting.

A more complete discussion on Spoon Graffiti is given in the Ami.d 07 paper "Abstracting connection volatility through tagged futures" by Johan Fabry and Carlos Noguera. The paper is not yet published, full reference information will be made available as soon as possible.

Annotation overview

Below we give a short overview of the different annotations as defined in Graffiti. Please refer to the Ami.d 07 paper for a full explanation.

@Future(expression) Expression as a string, optional parameter.
Targets: Methods and Fields
Object type: Futures and Possible Futures
Purpose: Define return value / read value in offline state. No expression given states that the method / var read blocks when offline.

@Connect
Targets: Methods
Object type: Futures
Purpose: Method responsible for future realisation

@Observedfuture
Targets: Local variables (inside methods)
Object type: Future Observers
Purpose: Assigning to this variable makes the value an observed future

@Online
Targets: Methods
Object type: Future Observers
Purpose: Notification method of futures having been realised

@Offline
Targets: Methods
Object type: Future Observers
Purpose: Notification method of objects having been reverted to futures

Methods that are tagged with @Online or @Offline must have one single argument of a type that is a future. These types are used, analoguous to the event system in Java, to allow different methods to be called for different types of futures. The argument that is passed to the method is the realized future for @Online methods and the future to which the object reverted for @Offline methods.

How to get Graffitti?

Get the latest version (H4c|<z0R) from the CVS