DSL presentation at the local Software Craftsmanship group

A couple of days ago I gave a talk at the local Software Craftsmanship group on the subject of Domain Specific Languages (DSL) and fluent interfaces. After the session I prepared an exercise for the audience:
Create a fluent interface for an online shop that calculates discounts based on customer and purchase information.
I gave a list of use cases and waited to see what would happen:
I was expecting API along these lines:
The group was divided to teams of 2-3 developers choose a programming language and started working on my exercise. The first thing I’ve noticed is diversity in programming languages – C#, Java, C++ (on Linux!), Python and Ruby were used.
After a while it has become clear that the room was divided into two main groups of thought. Some teams started to design the object model required to solve the problem while other teams started implementing the rules and created the fluent interface from the required rule. This made me think about upfront design vs. iterative development. No one managed to complete the entire exercise but the teams that choose to design up front managed to cover less rules than the teams that created the rules one by one.
It was fun watching teams designing an API and then finding ways to create the API they wanted. I saw some interesting implementation ideas that were very different from what I had in mind in a good way.
All in all it was a good meet-up I can’t wait for the next time.
Domain specific languages

The session (in Hebrew) can be viewed here - thanks to  Uri 

SCIL.DSL from Uri Lavi on Vimeo.

Labels: ,