Chapter 2. The DSL in the wild

This chapter covers

  • Designing your first Java-based DSL
  • Using Groovy to make your DSL more expressive
  • Patterns of DSL implementation
  • Choosing a DSL type

In the previous chapter, you saw how DSLs improve communication between the development team and the domain experts. We discussed the overall architecture of DSLs and the various execution models that they support. But what good are those DSLs without a meaningful, real-world use case? Given a real-world problem, how can you judge whether designing a DSL would be a better solution than using the traditional model of software development? In this chapter, we dive into these real-world pragmatics of DSL design.

We’ll start with a motivating example of the ground-up ...

Get DSLs in Action now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.