O'Reilly logo

Design Patterns in Ruby by Russ Olsen

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 16. Opening Up Your System with Domain-Specific Languages

In Chapter 15, we looked at the process of creating interpreters to solve certain kinds of problems. The Interpreter pattern is all about using an abstract syntax tree (AST) to obtain the answer or perform the action that you are looking for. As we saw in that chapter, the Interpreter pattern is not really concerned with where the AST comes from; it just assumes that you have one and focuses on how the AST should operate. In this chapter, we will explore the Domain-Specific Language (DSL) pattern, which looks at the world from the other end of the telescope. The DSL pattern suggests that you should focus on the language itself, not on the interpreter. It says that sometimes you ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required