John Slaby works for Raytheon, a large defense contractor, where he has tried over two dozen full-featured DSLs to support users within the company. But the teams using them have been dissolved and the value of the DSLs was somehow lost. And when new features needed to be added, this was done by different teams that did not understand the DSLs. So they ask “what is this, do we still need it?”
Why? DSLs need: specialized tooling, additional licensing, additional skills and maintenance not directly related to the product.
This has resulted at the fact that Raytheon in largely unable to remain using DSLs later in development projects.
John argues that fluent interfaces are the perfect middle ground between DSLs and custom code. Not just because no special tools or skills are needed, but also because they are testable and can be managed in the same way as the code base.
He presents an example: a baseball app. For the non-US audience, he elaborates on some of the crazy baseball rules. One of the reason for using fluent interfaces was the troubles of testing. Explained in one screen:
In addition to unit testing, fluent interfaces also ease integration testing, as it is easy to express real life scenario’s. In the baseball case, John tested his scores against an open data set with scores:
In summary, John states that he loves fluent interfaces, because they are a great way to get organizations comfortable with domain specific languages.