ABSTRACT
This paper describes a type system for JCop, which is an extension of Java with language mechanisms for context-oriented programming. A simple type system as in Java, however, is not sufficient to prevent errors due to the absence of invoked methods because interfaces of objects can change at run time by dynamic layer composition, a characteristic feature of context-oriented programming. Igarashi, Hirschfeld, and Masuhara have studied a type system for dynamic layer composition, but their type system is not directly applicable to JCop due to JCop-specific features such as layer inheritance, first-class layers, and declarative layer composition. We discuss how their type system can be extended to these language features.
- M. Appeltauer and R. Hirschfeld. The JCop language specification. Technical report, HPI, University of Potsdam, 2012.Google Scholar
- M. Appeltauer, R. Hirschfeld, and J. Lincke. Declarative layer composition with the JCop programming language. Journal of Object Technology, 12, 2013.Google Scholar
- N. Cardozo, S. González, K. Mens, R. Van Der Straeten, and T. D'Hondt. Modeling and analyzing self-adaptive systems with context petri nets. In Proc. of TASE, pages 191--198. IEEE, 2013. Google ScholarDigital Library
- P. Costanza and T. D'Hondt. Feature descriptions for context-oriented programming. In SPLC (2), pages 9--14, 2008.Google Scholar
- R. Hirschfeld, P. Costanza, and O. Nierstrasz. Context-oriented programming. Journal of Object Technology, 2008.Google Scholar
- R. Hirschfeld, A. Igarashi, and H. Masuhara. ContextFJ: A minimal core calculus for context-oriented programming. In Proc. of the FOAL2011, pages 19--23, Mar. 2011. Google ScholarDigital Library
- A. Igarashi, R. Hirschfeld, and H. Masuhara. A type system for dynamic layer composition. In Proc. of FOOL, Oct. 2012.Google Scholar
- A. Igarashi, B. C. Pierce, and P. Wadler. Featherweight Java: A minimal core calculus for Java and GJ. ACM TOPLAS, 2001. Google ScholarDigital Library
- H. Inoue. A proof of soundness of type system for dynamic layer composition. Undergraduate honors thesis, Kyoto University, 2013. In Japanese.Google Scholar
- T. Kamina, T. Aotani, and A. Igarashi. On-demand layer activation for type-safe deactivation. In Proc. of COP'14, Uppsala, Sweden, July 2014. Google ScholarDigital Library
- T. Kamina, T. Aotani, and H. Masuhara. EventCJ: a context-oriented programming language with declarative event-based context transition. In Proc. of ACM AOSD, pages 253--264. ACM, 2011. Google ScholarDigital Library
- G. Kiczales, E. Hilsdale, J. Hugunin, M. Kersten, J. Palm, and W. G. Griswold. An Overview of AspectJ. In Proc. of ECOOP'01, volume 2072 of Springer LNCS, pages 327--353, 2001. Google ScholarDigital Library
Index Terms
- Towards Type-Safe JCop: A type system for layer inheritance and first-class layers
Recommendations
A type system for first-class layers with inheritance, subtyping, and swapping
AbstractContext-Oriented Programming (COP) is a programming paradigm to encourage modularization of context-dependent software. Key features of COP are layers—modules to describe context-dependent behavioral variations of a software system—and ...
Highlights- A small calculus of JCop, an extension of Java for Context-Oriented Programming.
Type inference, principal typings, and let-polymorphism for first-class mixin modules
Proceedings of the tenth ACM SIGPLAN international conference on Functional programmingA mixin module is a programming abstraction that simultaneously generalizes λ-abstractions, records, and mutually recursive definitions. Although various mixin module type systems have been developed, no one has investigated principal typings or ...
Type inference, principal typings, and let-polymorphism for first-class mixin modules
ICFP '05: Proceedings of the tenth ACM SIGPLAN international conference on Functional programmingA mixin module is a programming abstraction that simultaneously generalizes λ-abstractions, records, and mutually recursive definitions. Although various mixin module type systems have been developed, no one has investigated principal typings or ...
Comments