Multiple Dispatch for Ambient Intelligence Sebasti´anGonz´alez Wolfgang De Meuter Kim Mens Departement d’Ingeni´ erie Informatique Programming Technology Lab Universit´ e catholique de Louvain Vrije Universiteit Brussel Belgium Belgium {sgm,km}@info.ucl.ac.be wdmeuter@vub.ac.be 29th May 2005 Abstract The paper promotes multiple dispatch as an advantageous feature for object technology geared towards Ambient Intelligence. Some of the design decisions and technical challenges that arise are discussed. 1 Introduction Developing object technology for Ambient Intelligence is not going to be easy. AmI poses hard conditions like frequent disconnection and low-resource computing (just to mention a few), and also it poses hard requirements, like unanticipated context-aware adaptation and unanticipated interaction of applications. We believe that object orientation can provide the right answers, but those answers are certainly not based on the kind of OO technology currently being deployed in industry and mainly being researched in the scientific world (namely class-based, statically typed languages). Looking for better models, we have come across a computation model which combines prototype-based programming and multiple dispatch. While not entirely new, the combination has recently reincarnated into the so-called PMD model [7]. PMD seems to us like a good start for developing AmI-geared object technology. In this paper we briefly present the model (section 2), describe its advantages (section 3) and show the challenges that we think will be faced in its adaptation to AmI (section 4). If short of time, the reader should focus attention on this last part. 2 PMD in a Nutshell PMD is a computation model based on the prototype-based model of Self [9], thus it is purely object-oriented, classless, with multiple dynamic inheritance and very uniform semantics. The distinguishing characteristic of PMD is that it mixes prototypes with multiple dispatch (hence the acronym PMD). The only current implementation is the Slate programming language. 1 [7] In this short presentation we put the emphasis on the multiple dispatch part, since that is the focus of the paper. In PMD, a method specifies the kinds of arguments for which its code is designed to work. These specifications are called argument specialisers, and arguments with such restrictions are called specialised arguments. As an example, consider the following method definition (using Slate syntax, which is Smalltalk-like): a@Set add: element [ "implementation here" ] 1 The Cecil language [2] matches very closely PMD, save that it restricts prototype delegation to be fixed at compile time, greatly restricting the benefits of prototypes. 1