skip to main content
article

Classless Java

Published:20 October 2016Publication History
Skip Abstract Section

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.

References

  1. Dart programming language. https://www.dartlang.org, 2016.Google ScholarGoogle Scholar
  2. D. Ancona and E. Zucca. A calculus of module systems. Journal of Functional Programming, 12(02):91–132, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  4. V. Bono, E. Mensa, and M. Naddeo. Trait-oriented programming in java 8. In PPPJ’14, 2014. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. G. Bracha and W. Cook. Mixin-based inheritance. In OOPSLA/ECOOP ’90, 1990. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. G. Bracha, P. Ahe, V. Bykov, Y. Kashai, and E. Miranda. The newspeak programming platform, 2008.Google ScholarGoogle Scholar
  7. K. B. Bruce. A paradigmatic object-oriented programming language: Design, static typing and semantics. Journal of Functional Programming, 4(02):127–206, 1994.Google ScholarGoogle ScholarCross RefCross Ref
  8. K. B. Bruce, M. Odersky, and P. Wadler. A statically safe alternative to virtual types. In ECOOP’98, 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. M. A. Ellis and B. Stroustrup. The annotated C++ reference manual. Addison-Wesley, 1990. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. E. Ernst, K. Ostermann, and W. R. Cook. A virtual class calculus. In POPL’06, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. E. Gamma, R. Helm, R. Johnson, and J. Vlissides. Design Patterns : Elements of Reusable Object-Oriented Software. Pearson Education, 1994. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  13. L. Liquori and A. Spiwack. Feathertrait: A modest extension of featherweight java. ACM Trans. Program. Lang. Syst., 30 (2):11, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. D. Malayeri and J. Aldrich. Cz: Multiple inheritance without diamonds. In OOPSLA ’09, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Neildo. Project lombok: Creating custom transformations. http://notatube.blogspot.hk/2010/12/ project-lombok-creating-custom.html, 2011.Google ScholarGoogle Scholar
  16. M. Odersky and al. An overview of the scala programming language. Technical Report IC/2004/64, EPFL Lausanne, Switzerland, 2004.Google ScholarGoogle Scholar
  17. J. Reppy and A. Turon. A foundation for trait-based metaprogramming. In International workshop on foundations and developments of object-oriented languages, 2006.Google ScholarGoogle Scholar
  18. C. Saito and A. Igarashi. Matching mytype to subtyping. Sci. Comput. Program., 78(7):933–952, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. M. Sakkinen. Disciplined inheritance. In ECOOP’89, 1989.Google ScholarGoogle Scholar
  20. N. Scharli, S. Ducasse, O. Nierstrasz, and A. P. Black. Traits: Composable units of behaviour. In ECOOP’03, 2003.Google ScholarGoogle ScholarCross RefCross Ref
  21. D. Ungar and R. B. Smith. Self: The power of simplicity. In OOPSLA ’87, 1987. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  23. P. Wadler. The Expression Problem. Email, Nov. 1998.Google ScholarGoogle Scholar
  24. Discussion on the Java Genericity mailing list.Google ScholarGoogle Scholar
  25. Y. Wang and B. C. d. S. Oliveira. The expression problem, trivially! In Proceedings of the 15th International Conference on Modularity, 2016. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. 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 ScholarGoogle Scholar
  27. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  28. M. Zenger and M. Odersky. Independently extensible solutions to the expression problem. In FOOL’05, 2005.Google ScholarGoogle Scholar
  29. E. Zucca, M. Servetto, and G. Lagorio. Featherweight Jigsaw - A minimal core calculus for modular composition of classes. In ECOOP’09, 2009.Google ScholarGoogle Scholar
  30. R. Zwitserloot and R. Spilker. Project lombok. http:// projectlombok.org, 2016.Google ScholarGoogle Scholar

Index Terms

  1. Classless Java

        Recommendations

        Comments

        Login options

        Check if you have access through your login credentials or your institution to get full access on this article.

        Sign in

        Full Access

        • Published in

          cover image ACM SIGPLAN Notices
          ACM SIGPLAN Notices  Volume 52, Issue 3
          GPCE '16
          March 2017
          212 pages
          ISSN:0362-1340
          EISSN:1558-1160
          DOI:10.1145/3093335
          Issue’s Table of Contents
          • cover image ACM Conferences
            GPCE 2016: Proceedings of the 2016 ACM SIGPLAN International Conference on Generative Programming: Concepts and Experiences
            October 2016
            212 pages
            ISBN:9781450344463
            DOI:10.1145/2993236

          Copyright © 2016 ACM

          Publisher

          Association for Computing Machinery

          New York, NY, United States

          Publication History

          • Published: 20 October 2016

          Check for updates

          Qualifiers

          • article

        PDF Format

        View or Download as a PDF file.

        PDF

        eReader

        View online with eReader.

        eReader
        About Cookies On This Site

        We use cookies to ensure that we give you the best experience on our website.

        Learn more

        Got it!