Multimethods for Context-Awareness Sebasti´ anGonz´alez 1 , Stijn Mostinckx 2 , Pascal Costanza 2 , Kim Mens 1 , and Wolfgang De Meuter 2 1 epartement d’Ingeni´ erie Informatique 2 Programming Technology Lab Universit´ e catholique de Louvain, Belgium Vrije Universiteit Brussel, Belgium {s.gonzalez,kim.mens}@uclouvain.be {smostinc,pcostanz,wdmeuter}@vub.ac.be Abstract The increasing availability of mobile devices and the wireless networks that connect them sets the stage for the introduction of context- aware applications. Current context-aware applications typically achieve adaptation to context by hard-coding decisions. In this paper we present an alternative approach based on classless objects in combination with distributed multimethods to develop more flexible context-aware appli- cations. 1 Motivation The introduction of mobile devices equipped with wireless network provisions, allows for present-day applications to become aware of their environment and to interact with it. Unfortunately, the incorporation of context information into running applications is currently often achieved using ad hoc mechanisms. To allow for an application to behave differently in a given context, this context- specific behaviour is typically hard-wired in the application under the form of if -statements scattered in method bodies or by using design patterns [7] (e.g. the Decorator, State and Strategy patterns). As an alternative solution, in this paper we explore the PMD object model [10] – which features prototypes and multiple dispatch – in the context of distributed systems. Our distributed ex- tension provides a structured mechanism to deal with contextual information in an extensible, flexible and high-level manner. Context-aware distributed applications rely on a context architecture that represents the input from sensors (and possibly other applications) in a way that is meaningful to the application. The architecture used in this paper is akin to that of the Context Toolkit [6], using objects to aggregate the context derived from different (interpretations of) sensor data. The chief difference with our approach lies in the way the context architecture will be employed by the applications that rely on it. To avoid hard-wiring context-related behaviour in- side the application, the aggregator directly influences the dispatch of methods. In other words, the programming model provides direct support for Context- Oriented Programming [4]. S. Gonz´alez is funded by the Fonds pour la Formation `a la Recherche dans l’Industrie et dans l’Agriculture (FRIA, Belgium). S. Mostinckx is funded by the Institute for the Promotion of Innovation through Science and Technology in Flanders (IWT, Belgium).