With advances in sensor-based computing and mobile communication, people have started to explore ubiquitous or pervasive computing systems that aim to have computing devices literally available everywhere, making them disappear into the physical environment. Novel ubiquitous computing applications such as intelligent vehicles, smart buildings, and traffic management have special properties that traditional computing applications do not possess, such as context-awareness, massive decentralisation, autonomous behaviour, adaptivity, proactivity, and innate collaboration. In this paper we argue that these require a new computational model and middleware that can reflect the autonomy and spontaneity of cooperative entities. The EU funded CORTEX project proposes the sentient object model to support the construction of such large-scale applications. We report on a flexible, run-time reconfigurable component based middleware that we have used to engineer the sentient object programming paradigm. We demonstrate the appropriateness of the novel computational model and validity of the middleware by constructing a proof of concept demonstrator based on the notion of autonomous cooperating vehicles.