skip to main content
10.1145/1411732.1411758acmconferencesArticle/Chapter ViewAbstractPublication PagespppjConference Proceedingsconference-collections
research-article

Embedded typesafe domain specific languages for Java

Published: 09 September 2008 Publication History

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.

References

[1]
J. Aasaru. Typesafe DSL for Relational Data Manipulation in Java. Master's thesis, University of Tartu, 2008.
[2]
C. Bauer and G. King. Hibernate in action. Manning, 2005.
[3]
J. Bentley and J. Bentley. Programming Pearls. Addison-Wesley Professional, 1999.
[4]
B. Bringert, A. Höckersten, C. Andersson, M. Andersson, M. Bergman, V. Blomqvist, and T. Martin. Student paper: HaskellDB improved. Proceedings of the ACM SIGPLAN workshop on Haskell, pages 108--115, 2004.
[5]
E. Bruneton, R. Lenglet, and T. Coupaye. ASM: a code manipulation tool to implement adaptable systems. Adaptable and Extensible Component Systems, 2002.
[6]
J. Cuadrado and J. Molina. Building Domain-Specific Languages for Model-Driven Development. Software, IEEE, 24(5):48--55, 2007.
[7]
M. Fowler and E. Evans. Fluentlnterface at http://www.martinfowler.com/bliki/FluentInterface.html, 2005.
[8]
S. Freeman, T. Mackinnon, N. Pryce, and J. Walnes. jMock: supporting responsibility-based design with mock objects. Conference on Object Oriented Programming Systems Languages and Applications, pages 4--5, 2004.
[9]
E. Gamma, R. Helm, R. Johnson, and J. Vlissides. Design patterns: elements of reusable object-oriented software. Addison-Wesley Longman Publishing Co., Inc. Boston, MA, USA, 1995.
[10]
P. Hudak. Building domain-specific embedded languages. ACM Comput. Surv., page 196, 1996.
[11]
T. Lindholm and F. Yellin. Java Virtual Machine Specification. Addison-Wesley Longman Publishing Co., Inc. Boston, MA, USA, 1999.
[12]
A. van Deursen, P. Klint, and J. Visser. Domain-specific languages: an annotated bibliography. ACM SIGPLAN Notices, 35(6):26--36, 2000.

Cited By

View all
  • (2023)Method Chaining Redux: An Empirical Study of Method Chaining in Java, Kotlin, and Python2023 IEEE/ACM 20th International Conference on Mining Software Repositories (MSR)10.1109/MSR59073.2023.00080(546-557)Online publication date: May-2023
  • (2018)Evaluating the productivity of a reference-based programming approachInformation and Software Technology10.1016/j.infsof.2014.05.00356:10(1390-1402)Online publication date: 30-Dec-2018
  • (2014)Design Patterns and Design Principles for Internal Domain-Specific LanguagesComputational Linguistics10.4018/978-1-4666-6042-7.ch017(352-410)Online publication date: 2014
  • Show More Cited By

Comments

Information & Contributors

Information

Published In

cover image ACM Conferences
PPPJ '08: Proceedings of the 6th international symposium on Principles and practice of programming in Java
September 2008
198 pages
ISBN:9781605582238
DOI:10.1145/1411732
  • Conference Chairs:
  • Luis Veiga,
  • Vasco Amaral
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 ACM 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]

Sponsors

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 09 September 2008

Permissions

Request permissions for this article.

Check for updates

Qualifiers

  • Research-article

Funding Sources

Conference

PPPJ08
Sponsor:

Acceptance Rates

Overall Acceptance Rate 29 of 58 submissions, 50%

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)1
  • Downloads (Last 6 weeks)0
Reflects downloads up to 07 Mar 2025

Other Metrics

Citations

Cited By

View all
  • (2023)Method Chaining Redux: An Empirical Study of Method Chaining in Java, Kotlin, and Python2023 IEEE/ACM 20th International Conference on Mining Software Repositories (MSR)10.1109/MSR59073.2023.00080(546-557)Online publication date: May-2023
  • (2018)Evaluating the productivity of a reference-based programming approachInformation and Software Technology10.1016/j.infsof.2014.05.00356:10(1390-1402)Online publication date: 30-Dec-2018
  • (2014)Design Patterns and Design Principles for Internal Domain-Specific LanguagesComputational Linguistics10.4018/978-1-4666-6042-7.ch017(352-410)Online publication date: 2014
  • (2013)Utilizing Application Frameworks: A Domain Engineering ApproachDomain Engineering10.1007/978-3-642-36654-3_5(113-130)Online publication date: 31-May-2013
  • (2012)Toward a Tool-Based Development Methodology for Pervasive Computing ApplicationsIEEE Transactions on Software Engineering10.1109/TSE.2011.10738:6(1445-1463)Online publication date: 1-Nov-2012
  • (2011)Domain-specific profilingProceedings of the 49th international conference on Objects, models, components, patterns10.5555/2025896.2025903(68-82)Online publication date: 28-Jun-2011
  • (2011)Domain-Specific ProfilingObjects, Models, Components, Patterns10.1007/978-3-642-21952-8_7(68-82)Online publication date: 2011
  • (2010)Compiler Plugins Can Handle Nested Languages: AST-Level Expansion of LINQ Queries for JavaObject Databases10.1007/978-3-642-14681-7_3(41-58)Online publication date: 2010
  • (2009)Compiler plugins can handle nested languagesProceedings of the Second international conference on Object databases10.5555/1883713.1883716(41-58)Online publication date: 1-Jul-2009
  • (2009)A generative programming approach to developing pervasive computing systemsACM SIGPLAN Notices10.1145/1837852.162162945:2(137-146)Online publication date: 4-Oct-2009
  • Show More Cited By

View Options

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Figures

Tables

Media

Share

Share

Share this Publication link

Share on social media