Research in context-aware computing has produced a number of application prototypes, frameworks, middlewares and models for describing context. However, development of ubiquitous context-aware applications is still a difficult task because current middleware systems are focused on isolated and static context-aware environments. Currently, applications require a global knowledge of the context-aware infrastructures in order to establish context-based interactions, and they suffer of problems such as disruptions when a context-aware environment evolves. The goal of this thesis is to develop a distributed middleware for context-aware computing that allows applications to maintain context-based continuous interactions, even in a highly dynamic environment. In order to achieve this goal, we propose a context management strategy based on context domains. We argue that this approach supports four important requirements for context-aware ubiquitous applications: distributed management of con...