skip to main content
10.1145/3567512.3567533acmconferencesArticle/Chapter ViewAbstractPublication PagessplashConference Proceedingsconference-collections
research-article

Yet Another Generating Method of Fluent Interfaces Supporting Flat- and Sub-chaining Styles

Published:01 December 2022Publication History

ABSTRACT

Researchers discovered methods to generate fluent interfaces equipped with static checking to verify their calling conventions. This static checking is done by carefully designing classes and method signatures to make type checking to perform a calculation equivalent to syntax checking. In this paper, we propose a method to generate a fluent interface with syntax checking, which accepts both styles of method chaining; flat-chaining style and sub-chaining style. Supporting both styles is worthwhile because it allows programmers to wrap out parts of their method chaining for readability. Our method is based on grammar rewriting so that we could inspect the acceptable grammar. In conclusion, our method succeeds generation when the input grammar is LL(1) and there is no non-terminal symbol that generates either only an empty string or nothing.

References

  1. Alfred Aho, Jeffrey Ullman, Ravi Sethi, and Monica Lam. 2006. Compilers: Principles, Techniques, and Tools (2 ed.). Addison Wesley. isbn:978-0321486813 Google ScholarGoogle Scholar
  2. Yossi Gil and Tomer Levy. 2016. Formal Language Recognition with the Java Type Checker. In Proceedings of 30th European Conference on Object-Oriented Programming. https://doi.org/10.4230/LIPIcs.ECOOP.2016.10 Google ScholarGoogle ScholarCross RefCross Ref
  3. Yossi Gil and Ori Roth. 2019. Fling - A Fluent API Generator. In 33rd European Conference on Object-Oriented Programming (ECOOP 2019). https://doi.org/10.4230/LIPIcs.ECOOP.2019.13 Google ScholarGoogle ScholarCross RefCross Ref
  4. Radu Grigore. 2017. Java Generics Are Turing Complete. In Proceedings of the 44th ACM SIGPLAN Symposium on Principles of Programming Languages. isbn:9781450346603 https://doi.org/10.1145/3009837.3009871 Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Dick Grune, Kees van Reeuwijk, Henri E. Bal, Ceriel J.H. Jacobs, and Koen Langendoen. 2012. Modern Compiler Design (2 ed.). Springer New York, NY. isbn:978-1-4614-4699-6 https://doi.org/10.1007/978-1-4614-4699-6 Google ScholarGoogle ScholarCross RefCross Ref
  6. 2000. jMock - An Expressive Mock Object Library for Java. http://jmock.org/ Google ScholarGoogle Scholar
  7. 2009. jOOQ: The easiest way to write SQL in Java. https://www.jooq.org/ Google ScholarGoogle Scholar
  8. Tomer Levy. 2017. A Fluent API for Automatic Generation of Fluent APIs in Java. Master’s thesis. Israel Institute of Technology. Google ScholarGoogle Scholar
  9. Tomoki Nakamaru and Shigeru Chiba. 2020. Generating a Generic Fluent API in Java. The Art, Science, and Engineering of Programming, 4, 3 (2020), 9. https://doi.org/10.22152/programming-journal.org/2020/4/9 Google ScholarGoogle ScholarCross RefCross Ref
  10. Tomoki Nakamaru, Kazuhiro Ichikawa, Tetsuro Yamazaki, and Shigeru Chiba. 2017. Silverchain: a fluent API generator. In Proceedings of the 16th ACM SIGPLAN International Conference on Generative Programming: Concepts and Experiences. https://doi.org/10.1145/3136040.3136041 Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Tomoki Nakamaru, Tomomasa Matsunaga, Tetsuro Yamazaki, Soramichi Akiyama, and Shigeru Chiba. 2020. An Empirical Study of Method Chaining in Java. In Proceedings of the 17th International Conference on Mining Software Repositories (MSR ’20). Association for Computing Machinery, New York, NY, USA. 93–102. isbn:9781450375177 https://doi.org/10.1145/3379597.3387441 Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Ori Roth. 2021. Study of the Subtyping Machine of Nominal Subtyping with Variance. Proc. ACM Program. Lang., 5, OOPSLA (2021), Article 137, oct, 27 pages. https://doi.org/10.1145/3485514 Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. 2014. Java Platform Standard Edition 8 Documentation - interface Stream<T>. https://docs.oracle.com/javase/jp/8/docs/api/java/util/stream/Stream.html Google ScholarGoogle Scholar
  14. Hao Xu. 2010. EriLex: An Embedded Domain Specific Language Generator. Springer-Verlag, 192–212. isbn:978-3-642-13953-6 https://doi.org/10.1007/978-3-642-13953-6_11 Google ScholarGoogle ScholarCross RefCross Ref
  15. Tetsuro Yamazaki, Tomoki Nakamaru, Kazuhiro Ichikawa, and Shigeru Chiba. 2019. Generating a Fluent API with Syntax Checking from an LR Grammar. Proc. ACM Program. Lang., 3, OOPSLA (2019), Article 134, oct, 24 pages. https://doi.org/10.1145/3360560 Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Yet Another Generating Method of Fluent Interfaces Supporting Flat- and Sub-chaining Styles

      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
      • Published in

        cover image ACM Conferences
        SLE 2022: Proceedings of the 15th ACM SIGPLAN International Conference on Software Language Engineering
        November 2022
        278 pages
        ISBN:9781450399197
        DOI:10.1145/3567512

        Copyright © 2022 ACM

        Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than the author(s) must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected].

        Publisher

        Association for Computing Machinery

        New York, NY, United States

        Publication History

        • Published: 1 December 2022

        Permissions

        Request permissions about this article.

        Request Permissions

        Check for updates

        Qualifiers

        • research-article

        Upcoming Conference

      PDF Format

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader