The increasing popularity of mobile devices, such as mobile phones and personal digitaludassistants, and advances in wireless networking technologies, are enabling new classesudof applications that present challenging problems to application designers. Applicationsudhave to be aware of, and adapt to, variations in the execution context, such as udfluctuatingudnetwork bandwidth and decreasing battery power, in order to deliver a good quality ofudservice to their users.udWe argue that building applications directly on top of the network operating systemudwould be extremely tedious and error-prone, as application developers would have touddeal with these issues explicitly, and would consequently be distracted from the actualudrequirements of the application they are building. Rather, a middleware layered betweenudthe network operating system and the application should provide application developersudwith abstractions and mechanisms to deal with them.udWe investigate the principle of reflection and demonstrate how it can be used to supportudcontext-awareness and dynamic adaptation to context changes. We offer application engineersudan abstraction of middleware as a dynamically customisable service provider, whereudeach service can be delivered using different policies when requested in different contexts.udBased on this abstraction, current middleware behaviour, with respect to a particularudapplication, is reified in an application profile, and made accessible to the application forudrun-time inspection and adaptation. Applications can use the meta-interface that theudmiddleware provides to change the information encoded in their profile, thus tailoringudmiddleware behaviour to the user's needs. However, while doing so, conflicts may arise;uddifferent users may have different quality-of-service needs, and applications, in an attemptudto full these needs, may customise middleware behaviour in conflicting ways. These conflicts have to be resolved in order to allow applications to come to an agreement, and thusudbe able to engage successful collaborations.udWe demonstrate how microeconomic techniques can be used to treat these kinds of conflicts. We offer an abstraction of the mobile setting as an economy, where applicationsudcompete to have a service delivered according to their quality-of-service needs. We haveuddesigned a mechanism where middleware plays the role of the auctioneer, collecting bidsudfrom the applications and delivering the service using the policy that maximises socialudwelfare; that is, the one that delivers, on average, the best quality-of-service.udWe formalise the principles discussed above, namely reflection to support context-awarenessudand microeconomic techniques to support conflict resolution. To demonstrate their effectivenessudin fostering the development of context-aware applications, we discuss a middlewareudarchitecture and implementation (CARISMA) that embed these principles, and reportudon performance and usability results obtained during a thorough evaluation stage.
展开▼