Embedded typesafe domain specific languages for Java

  • Authors:
  • Jevgeni Kabanov;Rein Raudjärv

  • Affiliations:
  • University of Tartu, Tartu, Estonia;University of Tartu, Tartu, Estonia

  • Venue:
  • Proceedings of the 6th international symposium on Principles and practice of programming in Java
  • Year:
  • 2008

Quantified Score

Hi-index 0.00

Visualization

Abstract

Projects like jMock and Hibernate Criteria Query introduced embedded DSLs into Java. We describe two case studies in which we develop embedded typesafe DSLs for building SQL queries and engineering Java bytecode. We proceed to extract several patterns useful for developing typesafe DSLs for arbitrary domains. Unlike most previous Java DSLs we find that mixing the Fluent Interface idiom with static functions, metadata and closures provides for a better user experience than pure method chaining. We also make very liberal use of the Java 5 Generics to improve the type safety properties of the DSLs.