Volatile Sets: Event-driven Collections for Mobile Ad-Hoc Applications - Harnie, Dies; Gonzalex Boix, Elisa; Lombide Carreton, Andoni; Scholliers, Christophe; De Meuter, Wolfgang (Electronic Communications of the EASST, 2011)
In mobile peer-to-peer applications, a common pattern is to maintain a collection of remotely-hosted objects. Traditional approaches require programmers to manually track the connectivity state of these remote objects and add them or remove them from local collections on a per-object basis. Because this happens concurrently with the rest of the application code, it hinders the composability of such collections and leads to subtle and hard to find bugs. In this paper, we propose an abstraction called volatile sets that allows the contents of the set to be specified intensionally. Additionally, volatile sets offer an event-driven API that signals when remote objects appear, disappear or change. Finally, volatile sets can be easily and efficiently composed through traditional set operations. We show how volatile sets ease the development of a collaborative peer-to-peer drawing application.