At work I was given the opportunity to build a new piece of complex functionality for the application that I have been working on for the last 6 months. After taking the excellent Nothin But .NET training course instructed by Jean-Paul Boodhoo I decided to try building the new functionality using the domain driven design techniques I learnt at the course.
To me, the domain driven design section of the course was a real eye opener, it taught me to concentrate on the problem I was trying to solve and not worry about infrastructure code.
To start off the process I met with the domain expert and tried my best to come up with a ubiquitous language that made sense to both of us. It was hard not to talk about interfaces and classes with the domain expert. I even noticed that the domain expert at times would try to translate things into technological terms for me.
Next I created a new solution completely separate from the solution that already existed. My reason for doing this was that before I even started trying to create the new functionality for our system, there was data waiting for me in the database whose sole purpose was to assist me in solving the problem at hand. That data to me, would only distract me from solving the problem and have me worrying about how I was going to get it out of the database.
I wrote my tests first and refined the design of the domain a little at a time only when a new problem presented itself. The next thing I new the problem I was trying to solve had solved itself slowly using tests and small concentrated refactorings. The hardest part was not getting ahead of myself and trying to stay disciplined throughout the process.
I am pretty proud of the solution I eventually came up with although I know that there is room for improvement in the steps I took to solve the problem and the code that I eventually came up with. If you have done domain driven design at work and have any tips for me I would love to hear them. This experience was highly rewarding and I'm not sure if I can go back to the way I coded before.