Context awareness, as one of the key techniques applied in ubiquitous computing, makes information technology invisible and seamless to people's daily living. As a result, numerous context frameworks have been developed for simplifying the development of context-aware applications by providing low-level context data operations such as acquisitions and simple aggregations in terms of APIs or toolkits. These frameworks are still falling short in requiring developers to explicitly deal with context-related tasks such as constraint enforcement in the application code. In this article, we present a framework to bridge the gap. More specifically, an application context model (ACM) is proposed for developers to specify their requirements on the context-related tasks. At application runtime, the ACM is instantiated for automatic context realization by the application context engine (ACE), which supports the full life cycle of each ACM instance (initialization, execution, and termination). We validate the concept of the framework through a case study, and present the experimental results based on the system prototype.