July 26, 2012, 10:31 AM — A DSL (domain-specific language) is a language designed for a business or industry domain such as health care, finance, or insurance. It defines processing in terms of the nouns and verbs of your business rather than in terms of a pure computer language.
In most cases, domain-specific languages look like stripped-down versions of English that incorporate business jargon. DSLs are especially powerful when used with a rules engine -- and most rules engines support some kind of DSL system.
[ Also on InfoWorld: Andrew Oliver embraces the programming language explosion. | Learn how to work smarter, not harder with InfoWorld's roundup of all the tips and trends programmers need to know in the Developers' Survival Guide. Download the PDF today! | Keep up with the latest developer news with InfoWorld's Developer World newsletter. ]
Compare this to the equivalent Java syntax:
A key advantage to this type of DSL is that business analysts who speak the jargon of the business, but who are not necessarily programmers, can write business rules on their own. On the other hand, programmers who need to know a lot about the business (but who are not necessarily qualified to determine business rules) can focus on the overall system.
Laying the groundwork for DSLsDSLs disrupt the conventional software development workflow: A subject matter expert (SME) describes a business concept to a developer, who may not fully understand it, but who then implements it in a language the SME can't read. With DSLs, the developer works with SMEs to define a language specification; the SME then describes the business rules in the new language.
When you compare the two methods of development, the DSL-oriented one looks pretty good. Plus, having your business rules described in a DSL decouples them from the code, so new team members don't have to search thousands of lines of code to find the rules.