Domain Specific Languages Vs Business Rules
Published by Rajgo October 8th, 2006 in Business Rules, BRMS, Rule Engine, QuickRules.NET, BRE, Business Rule Engine, Business Rules Management System, Domain Specific LanguagesI got into thinking a little more on Domain Specific Languages (DSL) after I hit this Post by Business Natural Language by Jay Fields It is a very enjoyable read on DSL. He uses a more appropriate term called Business Notation Languages (BNL).
A DSL simply put is a executable programming language that can be used to capture Business Logic specific to an Business/Domain Area. DSL’s are normally custom built, and come with some restrictions. One noteworthy feature of DSL’s is that they normally do not contain variables.
Jay Field mentions many advantages to using a DSL (BNL)
- Enable subject matter experts to specify the business logic in a natural language
- DSL’s are ideal for systems where the behavior often changes (Agility)
- DSL’s are useful in Systems that contain a large number of similar business logic(Structurally similar Rules)
- DSL’s are useful for any application that contains logic specific to the business.The more business specific logic you can abstract out of an application the less programmer involvement you will need to alter the business logic
All the above can be said for Business Rules as well. Using a DSL like Ruby obviously seems to work in some cases.Here is the example of rules that is used in Jay Field’s post
Employee: Jackie Johnson
compensate $3000 for each deal closed in the past 30 days
compensate $800 for each active deal that closed more than 365 days ago
compensate 5 percent of gross profits if gross profits are greater than $1,000,000
compensate 5 percent of gross profits if gross profits are greater than $2,000,000
So, can you really use DSL’s in place of a Business Rules Management System?
Well, think again ! Here are some points that I would mention before I proceed.
Rule Formats
- BRMS typically provide many Rule formats.These include the familiar If Then Rules, If Then Else Rules, Decision Tables, Graphical Sequential Rules etc. These formats can be easily setup for use by Business Users.
- Rule Formats like Decision Tables are very difficult to custom build as part of a Project. Decision Tables are used to capture structurally similar rules in a tabular XLS like format familiar to most Business Users. Many rules like the one above are best represented as Decision Tables.
- All BRMS provide the now famous Rete based Inference Engines. It is proven to be scalable & trustworthy for capturing & executing most common inference rules. Additionally, many BRMS provide separate execution Engines for Decision Tables and Graphical Sequential Rules.
- The runtime Rule Engines are proven in large enterprise scenarios with 100’s of Business Rules, and in some cases 1000’s.
- BRMS provide tight integration with most common MS Office Tools like Excel & Visio.This eases business user adoption in many cases.
Integration
- Rule Engines can be integrated into a wide variety of environments ranging from in-process, web-service, from inside workflow/BPM solutions.
Rule Repository & Maintenance
- BRMS provide Rule Repositories (or a Rule base) that will allow scalable enterprise wide deployment of Business Rules
- Security, access control for business rule maintenance are easily setup using a BRMS.
- BRMS provide well tested and proven Rule Maintenance toolkits. These are typically web based and built for Business Users.
DSL’s are certainly an option for small isolated implementations. In most other cases, using Business Rules might be a more reasonable choice.



















No Responses to “Domain Specific Languages Vs Business Rules”
Please Wait
Leave a Reply