As I continue to explore what we can do with DSL, I am getting more and more excited. Let us take a look at the following syntax:
when User.IsPreferred and Order.TotalCost > 1000: addDiscountPrecentage 5 applyFreeShipping when not User.IsPreferred and Order.TotalCost > 1000: suggestUpgradeToPreferred applyFreeShipping when User.IsNotPreferred and Order.TotalCost > 500: applyFreeShipping
The backend for that is a simple 68 lines class. Again, we had to extend the language to support the when keyword, but that is all we really had to do.
I tried to build the same using Windows Workflow, but I gave up after a few minutes. It was too much clicking, and not enough results.
It should look something like the image to the left, I assume.
From the perspective of maintainability and actually being able to look at what is going on, I know what I would like to have.
To be frank, I can't believe how easy this stuff is.