Domain-Driven Design in Ruby at DDD Exchange 2013 in London
Last week when I was in London I came across Leonardo DaVinci’s drawing, The Virgin and Child with St Anne and St John the Baptist, while wandering the National Gallery in London. It’s also known as The Burlington House Cartoon because drawings of this sort were usually transferred to a board for painting by pricking or incising the outline. With this cartoon, this has not been done, suggesting that the drawing has been kept as a work of art in its own right.
I see a sample app as functioning like this cartoon. It’s not a complete system, and is not intended to be prescriptive in any way. Rather, it is an along-the-way artifact created to learn. It’s a point-in-time snapshot of a much deeper, largely invisible, learning process, and thus is incomplete in that way too. When the sample app is done, it can function as a teaching tool, as a guide on the way to building something real. As a conversation starter and tradeoff clarifier.
Last Friday I presented at the DDD Exchange 2013 hosted by Skills Matter in London on what I’ve learned recently in exploring doing domain-driven design (DDD) in Ruby. The way I approached this exploration was to start porting the DDD sample app from Java and C# to Ruby. I wanted to do this because it would give me an opportunity to go much deeper in Ruby than every before, while applying DDD concepts and techniques I was familiar with in some unfamiliar ways using new tools.
I started the port to Ruby back in early May, and presented my early findings to an encouraging audience at DDD Denver on May 13. At that point I had only the domain model objects and some of the Rspec tests in place. Much of my time had been taken with investigating how best to implement value objects, and possible different approaches for the UI and for how to tackle enabling eventual consistency between aggregates. I had only begun to work out how to handle persistence with MongoDB.
When I gave the DDD Denver presentation, I was very nervous about presenting such an incomplete effort in public. But I found everyone to be very supportive and it inspired me to keep going. In the next four weeks I was able to solve all the big issues and prepare a presentation for DDD Exchange 2013. If you are interested, Skills Matter did an excellent job of recording the presentation and getting it online. See below for links to resources.
My hope is that this - currently very unfinished and unpolished - effort sparks interesting conversations about options, tradeoffs and possibilities, and helps others get to grips with the details of how to make DDD real on their projects.
Original slides for today's #dddx 2013 talk Domain-Driven Design with Ruby are now online at http://t.co/w9W3wvNz1J #DDDesign
— Paul Rayner (@thepaulrayner) June 14, 2013
Here’s a list of resources related to my presentation:
-
Sample app on Github - see the README for a comprehensive list of resources I’ve compiled as I’ve researched how to accomplish the Ruby port (including links to the Java and C# apps the port is based on).
A big thank you again to Skills Matter for hosting such a wonderful event and making it such a special day (for both me and my son).
Many thanks to all of today's speakers: @unclebobmartin @robsmallshire @thepaulrayner @zimakki You guys are awesome! #DDDx #FF (2/2)
— skillsmatter (@skillsmatter) June 14, 2013
##Tweets
Cargo sample is back in ruby ! #dddx
— Jérémie Chassaing (@thinkb4coding) June 14, 2013
Good session by @thepaulrayner about DDD with Ruby #dddx
— Nathan Gloyn (@NathanGloyn) June 14, 2013
@thepaulrayner talk about ruby at #dddx gave me some interesting ideas to explore. Great talk !
— Thomas Jaskula (@tjaskula) June 14, 2013
@thepaulrayner really rocked. Cleared away so much fog and sparkled a lot of cool ideas! Thanks! #dddx
— ziobrando (@ziobrando) June 14, 2013
Really, REALLY interesting session by @thepaulrayner about doing DDD in Ruby #DDDX
— Tom Janssens (@ToJans) June 14, 2013
Good idea to show the project directory tree to show how to apply DDD with Rails/MongoDB/Mongoid by @thepaulrayner at #dddx
— cyrille martraire (@cyriux) June 14, 2013
@thepaulrayner explaining how he did an hexagonal arch in rails application, really nice and clean #dddx
— Rui Carvalho (@rhwy) June 14, 2013
Looks like Ruby on Rails smackdown here between activerecord pattern and domain driven pattern. Who will win? #dddx
— DCU CoderDojo (@coderdojodcu) June 14, 2013
Actors are back in @thepaulrayner ruby presentation...
— Jérémie Chassaing (@thinkb4coding) June 14, 2013
Domain driven design with #ruby #dddx by @thepaulrayner pic.twitter.com/FMHMtgI1hX
— Rui Carvalho (@rhwy) June 14, 2013
As an exercise, I think I’ll be reimplementing in Python the #dddesign Ruby sample presented by @thepaulrayner at #dddx.
— Robert Smallshire (@robsmallshire) June 14, 2013
Had a good talk during the break with @thepaulrayner about evangelising #DDDesign in dynamic languages like ruby and php #dddx
— Mathias Verraes (@mathiasverraes) June 14, 2013
@thepaulrayner talk at #dddx #ruby pic.twitter.com/ryycPIso6k
— Thomas Jaskula (@tjaskula) June 14, 2013
And I just have to include this one…
Breaking News! Holy Camelshit! Is really possible to apply DDD with Rails! #dddx
— DDD Borat (@DDD_Borat) June 14, 2013