Abstract
This paper presents an OO style without classes, which we call interface-based object-oriented programming (IB). IB is a natural extension of closely related ideas such as traits. Abstract state operations provide a new way to deal with state, which allows for flexibility not available in class-based languages. In IB state can be type-refined in subtypes. The combination of a purely IB style and type-refinement enables powerful idioms using multiple inheritance and state. To introduce IB to programmers we created Classless Java: an embedding of IB directly into Java. Classless Java uses annotation processing for code generation and relies on new features of Java 8 for interfaces. The code generation techniques used in Classless Java have interesting properties, including guarantees that the generated code is type-safe and good integration with IDEs. Usefulness of IB and Classless Java is shown with examples and case studies.
- Dart programming language. https://www.dartlang.org, 2016.Google Scholar
- D. Ancona and E. Zucca. A calculus of module systems. Journal of Functional Programming, 12(02):91–132, 2002. Google Scholar
Digital Library
- L. Bettini, F. Damiani, I. Schaefer, and F. Strocco. Traitrecordj: A programming language with traits and records. Sci. Comput. Program., 78(5):521–541, 2013. Google Scholar
Digital Library
- V. Bono, E. Mensa, and M. Naddeo. Trait-oriented programming in java 8. In PPPJ’14, 2014. Google Scholar
Digital Library
- G. Bracha and W. Cook. Mixin-based inheritance. In OOPSLA/ECOOP ’90, 1990. Google Scholar
Digital Library
- G. Bracha, P. Ahe, V. Bykov, Y. Kashai, and E. Miranda. The newspeak programming platform, 2008.Google Scholar
- K. B. Bruce. A paradigmatic object-oriented programming language: Design, static typing and semantics. Journal of Functional Programming, 4(02):127–206, 1994.Google Scholar
Cross Ref
- K. B. Bruce, M. Odersky, and P. Wadler. A statically safe alternative to virtual types. In ECOOP’98, 1998. Google Scholar
Digital Library
- M. A. Ellis and B. Stroustrup. The annotated C++ reference manual. Addison-Wesley, 1990. Google Scholar
Digital Library
- E. Ernst, K. Ostermann, and W. R. Cook. A virtual class calculus. In POPL’06, 2006. Google Scholar
Digital Library
- E. Gamma, R. Helm, R. Johnson, and J. Vlissides. Design Patterns : Elements of Reusable Object-Oriented Software. Pearson Education, 1994. Google Scholar
Digital Library
- A. Igarashi, B. C. Pierce, and P. Wadler. Featherweight java: A minimal core calculus for java and gj. ACM Trans. Program. Lang. Syst., 23(3):396–450, 2001. Google Scholar
Digital Library
- L. Liquori and A. Spiwack. Feathertrait: A modest extension of featherweight java. ACM Trans. Program. Lang. Syst., 30 (2):11, 2008. Google Scholar
Digital Library
- D. Malayeri and J. Aldrich. Cz: Multiple inheritance without diamonds. In OOPSLA ’09, 2009. Google Scholar
Digital Library
- Neildo. Project lombok: Creating custom transformations. http://notatube.blogspot.hk/2010/12/ project-lombok-creating-custom.html, 2011.Google Scholar
- M. Odersky and al. An overview of the scala programming language. Technical Report IC/2004/64, EPFL Lausanne, Switzerland, 2004.Google Scholar
- J. Reppy and A. Turon. A foundation for trait-based metaprogramming. In International workshop on foundations and developments of object-oriented languages, 2006.Google Scholar
- C. Saito and A. Igarashi. Matching mytype to subtyping. Sci. Comput. Program., 78(7):933–952, 2013. Google Scholar
Digital Library
- M. Sakkinen. Disciplined inheritance. In ECOOP’89, 1989.Google Scholar
- N. Scharli, S. Ducasse, O. Nierstrasz, and A. P. Black. Traits: Composable units of behaviour. In ECOOP’03, 2003.Google Scholar
Cross Ref
- D. Ungar and R. B. Smith. Self: The power of simplicity. In OOPSLA ’87, 1987. Google Scholar
Digital Library
- D. Ungar and R. B. Smith. Self: The power of simplicity. In Conference Proceedings on Object-oriented Programming Systems, Languages and Applications, OOPSLA ’87, 1987. Google Scholar
Digital Library
- P. Wadler. The Expression Problem. Email, Nov. 1998.Google Scholar
- Discussion on the Java Genericity mailing list.Google Scholar
- Y. Wang and B. C. d. S. Oliveira. The expression problem, trivially! In Proceedings of the 15th International Conference on Modularity, 2016. Google Scholar
Digital Library
- Y. Wang, H. Zhang, B. C. d. S. Oliveira, and M. Servetto. Classless java - interface-based programming for the masses. Technical report, The University of Hong Kong, 2016.Google Scholar
- T. Würthinger, C. Wimmer, A. Wöß, L. Stadler, G. Duboscq, C. Humer, G. Richards, D. Simon, and M. Wolczko. One vm to rule them all. In Proceedings of the 2013 ACM international symposium on New ideas, new paradigms, and reflections on programming & software, 2013. Google Scholar
Digital Library
- M. Zenger and M. Odersky. Independently extensible solutions to the expression problem. In FOOL’05, 2005.Google Scholar
- E. Zucca, M. Servetto, and G. Lagorio. Featherweight Jigsaw - A minimal core calculus for modular composition of classes. In ECOOP’09, 2009.Google Scholar
- R. Zwitserloot and R. Spilker. Project lombok. http:// projectlombok.org, 2016.Google Scholar
Index Terms
Classless Java
Recommendations
Classless Java
GPCE 2016: Proceedings of the 2016 ACM SIGPLAN International Conference on Generative Programming: Concepts and ExperiencesThis paper presents an OO style without classes, which we call interface-based object-oriented programming (IB). IB is a natural extension of closely related ideas such as traits. Abstract state operations provide a new way to deal with state, which ...
Simulating multiple inheritance and generics in Java
This paper presents Java language from an object-oriented software construction perspective. It explains the implications of banning generics and multiple inheritance of classes, and explores the patterns and the idioms used by the Java designers and ...







Comments