On coercion in Context-Oriented Programming



Context-Oriented programming is a promising paradigm for adressing the crosscutting concerns in software. This paradigm allows for the specialization of classes and methods based on context. Yet, it does not provide mechanisms for object coercion, that is, converting an object existing in a given context into another version for another context. We expose how this problem is an important lack in the paradigm, providing examples from Climb, an image processing library developped at the LRDE. We present solutions for automatic context-based object coercion, and we analyze them in terms of simplicity and genericity.