Foundations for extensible objects with roles