On designing safe and flexible embedded DSLs with Java 5

  • Authors:
  • Jevgeni Kabanov;Michael Hunger;Rein Raudjärv

  • Affiliations:
  • Department of Computer Science, University of Tartu, Liivi 2, Tartu, Estonia;Dresden, Germany;Department of Computer Science, University of Tartu, Liivi 2, Tartu, Estonia

  • Venue:
  • Science of Computer Programming
  • Year:
  • 2011

Quantified Score

Hi-index 0.00

Visualization

Abstract

Although embedded DSLs are widely used in both functional and dynamic languages they are yet to be widely accepted in the Java community. The best available examples are projects like jMock and Hibernate Criteria Query. In this paper we introduce the design of three novel practical embedded DSLs that we designed to showcase the power of Java language and specifically the changes introduced in Java 5. One of those DSLs is fully implemented as an open source project and is gathering momentum in the community. We proceed to discuss the approaches that allow designing safe and flexible DSLs by extracting generic patterns where possible and describing more specific idioms where necessary. It is our goal that this paper would serve as a starting point for someone designing an embedded DSL that takes full advantage of the Java 5 features.