DDD Step By Step
A Practical Guide to Domain Driven Design

August 2009 - DDD on the Web

  • DDD Step by Step by Greg

    I don’t know how many people already know about this but figured I would put up a post about it as a pointer for those who have not seen it. I was surfing over at DDDStepByStep.com and there are *a lot* of new resources available there for people who are learning DDD. Casey Charaltan  Charlton :) is the one who has put it together and there is really some valuable information there. As an example he has (recently?) put up this about 50 page PDF that is a short book on getting started with DDD including many code examples. It also seems to contain a pretty good blog roll that can be subscribed to for those that are interested in DDD. Read More...
  • DDD - Microsoft Guidance

    According to Paul Gielens , Microsoft is working to include technical (?) DDD guidance into their next version of the Application Architecture Guide... I'm really looking forward to this ... Read More...
  • DDD - Slides Visug Talk

    Yesterday I delivered a talk to the belgian Visual Studio User Group, Visug, about the aspects of DDD that are mostly targetted at developers... I must admit that I really enjoyed the talk, there was great interest from the public, I got loads of questions. So I need to pay my gratitude to the audience. In case you missed it, or you would like to review the content once more, here are the slides: Domain Driven Design.pptx Read More...
  • DDD Talk - Some more seats added

    On June 16th I will be presenting a session on Domain Driven Design for the VISUG, the sessions was fully booked quite quickly... so I'm happy to hear that they have added more seats :) The talk will cover how DDD can be used as a pattern language. Secondly I will give you some real life design tips and tricks that will minimize the impact of refactoring during the life of your code. And finally I will give you some insights into how you can restructure your solutions so that you can focus on the most important parts. If you are interested in one of the available spots, sign up now ... Read More...
  • Refactoring Day 27 : Remove God Classes by schambers

    Often with legacy code bases I will often come across classes that are clear SRP violations. Often these classes will be suffixed with either “Utils” or “Manager”. Sometimes they don’t have this indication and are just classes with multiple grouped pieces of functionality. Another good indicator of a God class is methods grouped together with using statements or comments into seperate roles that this one class is performing. Over time, these classes become a dumping ground for a method that someone doesn’t have time/want to put in the proper class. The refactoring for situations like these is to break apart the methods into distinct classes that are responsible for specific roles. 1: public class CustomerService 2: { 3: public decimal CalculateOrderDiscount(IEnumerable<Product> products, Customer customer) 4: { 5: // do work 6: } 7:   8: public bool CustomerIsValid(Customer customer, Order order) 9: { 10: // do work 11: } 12:   13: public IEnumerable< string > GatherOrderErrors(IEnumerable<Product> products, Customer customer) 14: { 15: // do work 16: } 17:   18: public void Register(Customer customer) 19: { 20: // do work 21: } 22:   23: public void ForgotPassword(Customer customer) 24: { 25:...
  • Step by Step to Using MSpec (Machine.Specifications) with ReSharper by Sean Biefeld

    Whilst researching using MSpec with ReSharper I found it difficult to find all the resources I needed in one place. This is an attempt to condense everything into that one place and facilitate those seeking to accomplish the same task. Step 1 - Git It: First thing's first, grab the latest Machine Spec source from github. $ git clone git://github.com/machine.machine.specifications.git mspec Step 2 - Build It: Next, open it up in Visual Studio, set it to build in release mode and build it. Now the binaries will be ready for you. Step 3 - Setup ReSharper: Now we need to setup ReSharper to be able to utilize the MSpec framework and run the tests in ReSharper's test runner. To do this we need to add a plugins directory to the "JetBrains\ReSharper\v4.5\Bin" directory or the where ever the bin directory for your ReSharper is located. In the Plugins create a Machine.Specifications directory, so you should now have a path similar to; "JetBrains\ReSharper\v4.5\Bin\Plugins\Machine.Specifications". Place the following dlls in the newly created folder: Machine.Specifications.ReSharperRunner.4.5.dll and Machine.Specifications.dll. Step 4 - Write some Specifications: Coolio, now to test...
  • Kanban In Time-Boxes: The Cadence of WIP and Sprints by derick.bailey

    A comment that was left on a previous post , and a response that I made to the comment, got me thinking about Kanban and time boxes such as Sprints or Iterations some more. As I stated in my response, I don’t think time boxes are “not Lean”, at this point. I still advocate and coach Scrum at my office. It is a significant improvement over the previous waterfall-ish chaos that our teams have operated in. I also advocate and coach Kanban. At times, the realms of Scrum and Kanban overlap, as well. “ ’There is nothing either good or bad’, said Shakespeare, ‘but thinking makes it so.’ ”          - Dale Carnegie, How To Win Friends And Influence People , p. 68 I don’t necessarily think time boxes like Scrum sprints are good or bad, anymore. The only way to know whether or not any part of our process is good or bad is to measure and monitor the process and use leading and trailing indictors to tell us what our problems and inefficiencies are and are not. With the right information in hand, we can ask what the economic impact of the process that we are following, actually is. This will tell us whether or not any part of our system is good, bad, or otherwise. Given my current feelings about Scrum and...
  • DDD is a dense book by Greg

    But seriously there is some classic humour if you look hard enough. My friend Matthieu Guyonnet-Duluc sent me this scan today definitely worth a smile. Read More...
  • Command Query Separation? by Greg

    There has been a lot of talk lately about Command and Query Separation. One thing that has come up with many people in learning it is that they get confused between CQS [Meyer] and CQS [Architecture or DDD]. As such many have called for us to rename the latter to something different as although it is very similar to CQS [Meyer] they find it to be quite different. I however disagree with this let’s look at our definitions. Meyer:    Separate command methods that change state from query methods that read state. Current:    Separate command messages that change state from query messages that read state. The reader should notice that these two are nearly identical, the principle has remained the same, only the definitions of what commands and queries are has changed. A really quick reader will also be quick to jump on me for not bringing in all of what CQS has come to be known as. In CQS [Architecture/DDD/whatever] we also go one step further and we create two end points (or objects) by splitting the responsibilities of the original concept. We give one sub-concept the responsibility of processing all of the commands and another the responsibility of processing all of the queries. We do this because we have come to...
  • JavaScript: A tool too sharp? by Jimmy Bogard

    Ehhhh…no. But, Roy Osherove believes so .  When I first started JavaScript, I thought so too.  My problem was that I approached JavaScript from the eyes of a C# developer.  But C#, JavaScript is not.  So what are the main gripes of JavaScript? No tooling No refactoring support No navigation support It’s not C# One solution is to use something like Script# to generate JavaScript from C#.  This is similar to the approach of the Google Web Toolkit, with the exception that GWT has a whole ecosystem to basically be able to develop Swing-like applications on the web. But something like Script#?  If you’re looking to program C# on the web, that’s the way to go.  But it’s a little unfortunate, as JavaScript is a very powerful language with features you simply can’t find in many other places.  The arguments against are very similar to what I’ve heard about other dynamic languages, yet the Rails developers seem to be productive.  Why is that? My opinion is that it’s simply a very different mindset working in a dynamic language.  And before libraries like jQuery that really used JavaScript like it should, it was a lot more difficult to do interesting things.  I can’t imagine giving up features...
  • [Training] Public Courses by Udi Dahan

    I’ve been getting more questions from readers as to when I’ll be giving a public course in their area, so I thought I’d put up a quick little post on the topic. Advanced Distributed Systems Design with SOA & DDD Sep 7th, London UK Oct 21, Brussels Belgium Nov 30, Austin Texas - USA Loosely-Coupled Messaging with NServiceBus Sep 16th, London [...] Read More...
    Filed under:
  • Refactoring Day 8 : Replace Inheritance with Delegation by schambers

    All too often inheritance is used in the wrong scenarios. Inheritance should only be used in logical circumstances but it is often used for convenience purposes. I’ve seen this many times and it leads to complex inheritance hierarchies that don’t make sense. Take the following code: 1: public class Sanitation 2: { 3: public string WashHands() 4: { 5: return "Cleaned!" ; 6: } 7: } 8: 9: public class Child : Sanitation 10: { 11: } In this instance, a Child is not a “Sanitation” and therefore doesn’t make sense as an inheritance hierarchy. We can refactor by initializing an instance of Sanitation in the Child constructor and delegating the call to the class rather than via inheritance. If you were using Dependency Injection, you would pass in the Sanitation instance via the constructor, although then you would need to register your model in your IoC container which is a smell IMO, you get the idea though. Inheritance should ONLY be used for scenarios where inheritance is warranted. Not instances where it makes it quicker to throw down code. 1: public class Sanitation 2: { 3: public string WashHands() 4: { 5: return "Cleaned!" ; 6: } 7: } 8: 9: public class Child 10: { 11: private Sanitation...
  • Employing the Domain Model Pattern by John Nuechterlein

    Udi Dahan has yet another good read in MSDN Magazine , where he talks about the domain model pattern . I particularly like a couple of things about it. One is a comment about what the domain model is not: If you had come to me a few years ago and asked me if I ever used the domain model pattern, I would have responded with an absolute "yes." I was sure of my understanding of the pattern. I had supporting technologies that made it work. But, I would have been completely wrong. ….the No. 1 most common fallacy about employing domain models. I myself was guilty of making this false assumption for a number of years and see now where it led me astray. Fallacy: Any persistent object model is a domain model First of all, a persistent object model does not inherently encapsulate all the behaviors of the business that are likely to change. Second, a persistent object model may include functionality that is not likely to change. This is a confusion that I’ve seen come up in a number of different ways. At one of our Chicago Alt.NET meetings, we did a fishbowl session that revolved around DDD and whether it was worth it (or something like that), and a number of people seemed to make the mistake of thinking that if you started off with...