DDD Step By Step
A Practical Guide to Domain Driven Design

June 2009 - DDD on the Web

  • How we do MVC – View models by Jimmy Bogard

    A while back, I went over a few of the patterns and opinions we’ve gravitated towards on our current large-ish ASP.NET MVC project, or, how we do MVC .  Many of these opinions were forged the hard way, by doing the wrong thing many times until we found the “right” opinion.  Of course, many of these opinions are only really valid in the constraints of our project.  While the domain of this project isn’t important, here are some key aspects to consider: AJAX is used very, very sparingly.  Section 508 compliance is required XHTML compliance is also required XHTML DTD validation is also required All (well, 99%) operations revolve a single uber-entity.  Think customer relationship management, where everything you do deals with exactly one customer Snippets of information repeated across many screens Screens are either edit, or view, but never both.  (99% never) Given these constraints, these opinions may or may not apply to the project you work on.  Again, patterns are all about tradeoffs, benefits and liabilities.  But, opinionated software is like building a bullet train.  It goes extremely fast, but only in the direction you build it. That said, I’m going to go over some of the main aspects...
  • Becoming a better developer, or “How to sidestep a question” by Kyle Baley

    This post is over a week in the making. I attended AltNetBeers #9 last week in London which is making a quick rise in my list of top developer-related events, big or small. And that’s not just because I got one of the best compliments ever from someone who claims his non-IT friend reads a single IT-related blog (take that, Hanselman!). Anyway, it’s nice to know I’m reaching my target audience. The event was not altogether removed from what Sebastien outlined at the one I attended last year which shows a degree of vision to which I only aspire. We spent a couple of hours talking on a topic of choice (as voted by attendees), then socialized until the place closed down at the unreasonable hour of 11pm. I’m told much merriment ensued afterward but, after posing for a picture , I made my way back to the hotel. The topic at hand, and I’m paraphrasing: How do we become better developers today, and how do we create them tomorrow? Nice and subjectively vague, just how I like my open spaces. The runner up topic, brownfield applications, seemed suspiciously planted so I threw my weight behind the one we eventually chose. Kinda concerned at how often this image is relevant to my posts Conversation ran the usual gamut from apprenticeship programs...
  • Ubiquitous Language in Product Development by Dave Laribee

    Hi there. I got this question from a fellow named Martin today: Real simple ... most of the discussion on DDD surrounds the design in terms of the ubiquitous language. What if you are developing a product that is designed to be a tool for a certain industry, say marketing, but the processes and terminology all differ according to the marketing company that is in discussion. To be specific, one company may use the term Client and the other Customer? How do you accommodate the difference in terms? Do you code to a common denominator or do you just pick one and go? Great question; in product development we're often trying to make a general solution that solves the common problems of customers that have different languages. There's no way around that. First, find those elements that are universal. Question if there's really a need for all of this customization or if your clients are OK with calling a client a customer. Having a ubiquitous language that can be used end-to-end, from developer to end user, is extremely valuable and kind of the original point. For variable terms you should, in my estimation and experience, form an internal ubiquitous language that's adhered to across product management and software development...
  • Distributed Domain Driven Design and Aggregates by Jérémie Chassaing

    Once again, Gojko Adzic comes with an excellent post : Improving performance and scalability with DDD . Aggregates are often a bit underused in DDD because they’re difficult to grasp. They’re often seen as a solution to a technical problem. Gojko shows here how to understand them at a domain level. This post gives a clear vision of the role of Aggregates in DDD by placing it in the context of distributed environments. You should read it ! Read More...
  • Where are my Entities and my Repositories ? by Jérémie Chassaing

    During Evans’ talk at ParisJug , some attendees where surprised that there was no mention of Entities or Repositories … Quite a lot of people where introduced to Domain Driven Design by these aspects and see these as the main advance of DDD. In contrast, Eric Evans explained to me he had some regrets he placed these patterns so early in the book. Many readers think they know the most important at this point and stop reading after chapter 6. Actually those patterns are only object model patterns that enable Separation of Concerns and Persistence Ignorance, but can also be used in context that are not Domain Driven at all like CRUD. Of course, if you want to implement a domain independent of all infrastructure concerns, good OO practices will be required, but those practices won’t make your application Domain Driven (don’t understand that not following DDD would make your design a bad design… you apply DDD if you want and if you need to, but achieving persistence ignorance won’t mean you practice DDD.) But you’ve more to learn from Strategic Design, Bounded Contexts and distillation of the Core Domain etc. Read More...
  • We Are Not Doing DDD – Part Two - CQS by Jak Charlton

    From the beginning of my current project we have been working under some horrible constraints, many imposed by legacy systems, many by late decisions that would have speeded things immensely if made earlier, and many imposed by decisions that are outside of my control. This lead us early on to make decisions on architecture that eliminated any possibility of using DDD heavily, and as I mentioned in my original post about this project it is also essentially a glorified CRUD system - we read data from databases, we modify it a bit, and we put it back again. What We Are Doing – Command Query Separation The first architectural choice that I made, and in hindsight got accepted with relative ease, was to employ CQS to simplify the system. Earlier projects had suffered quite badly from being abstractions of legacy systems with new functionality bolted on. As far as possible I wanted to eliminate this problem from our project, as I was all too aware that this was an easy trap for the team to fall into, and would burn a lot of development time very fast. To make the system simpler I chose to separate our query mechanisms from the "domain" type stuff, our commands and data writing/updating code. CQS is a pretty simple concept. One...
  • This Code for Rent by Scott Densmore

    Given the current economy and the housing market here in Florida, we have been talking a lot about renting versus owning a home. How does this have anything to do with code? Glad you asked. In the life of any given application, you are probably in it for only a short time (relatively). You might be on the team that builds the version 1.0 product or you might be on the team that is supporting version 6 of a product on version 8. Whatever the case may be, more often than not, you are just there renting the code. I think this is an important fact to remember. My friend Brain Button taught me a long time that I am not my code and that I definitely do not own it. When I put myself in the mindset of a renter instead of an owner, the idea of The Broken Theory makes perfect sense. When you rent a home / apartment / car, you sign an agreement to take the best care of the thing you are renting the best that you can. Why should that not be any different for code? No matter how you decide to take care of the code you are renting, you should always feel good when you turn (check) it in. Oblivion by Mastodon Read More...
  • F# – Async Running with Continuation Scissors by Matthew.Podwysocki

    As you may have noticed, I’ve been covering a bit about concurrency on this blog lately, and for good reason.  Between Axum, Erlang, Scala and F#, there is a lot to explore with actor model concurrency, task based concurrency, data parallel applications and so on.  In the next couple of months, I have some talks coming up on concurrency and in particular with F#.  I’ve been covering a bit of that with F# and mailbox processing, but I wanted to step back a bit into the asynchronous workflows and hitting against a well known API.  In this case, let’s walk through a simple example of using the Twitter HTTP API to get a user timeline using F# asynchronous workflows.  Best of all, I’ve done all of the above code without ever once opening up Visual Studio and instead using the power of a simple text editor and F# interactive, I’m able to be quite productive.  It certainly makes me rethink my utter dependence on certain tools… Give me some tweets… eventually, when you get around to it In order to get started, we need some helpers when dealing with LINQ to XML.  In a previous post , I talked about the need for such a thing due to the lack of implicit operator support in F#.  We can use the same operator...
  • Strategic Design at DDD Exchange by Jérémie Chassaing

    Gojko Adzik has a post about Eric Evans’ talk at DDD Exchange : Why do efforts to replace legacy system fail ? You can also read my previous post about strategic design . I’m currently working on evolving a large legacy system, and my experience tell me it’s the right way to deal with it ! Don’t try to switch off legacy system. Go along with it using anticorruption layers to protect you elegant core domain. Read More...
  • If You're Looking for Nothin But .Net . . . by gregorylong

    I attended JP's Nothin But .Net course ( http://www.jpboodhoo.com/training.oo ) last week and I wanted to share my perspective with anyone who might be considering the course. I really enjoyed the experience and I'd happily recommend the course . . . to the right people. Rather than do the usual "I recommend this course because blah, blah, blah" I'd like to tell you why you shouldn't or wouldn't want to attend. If you make to the end of this post and still want to attend, I highly recommend you do as soon as possible. If you already have an incredibly strong understanding of the .Net Framework, TDD, BDD, DDD, or if you have a style/way of programming that is perfectly effective and satisfying for you then don't attend. If fact, if you're any good at teaching, you might wish to start your own course. If you are very comfortable with your life and your method of programming and you don't wish to be challenged then this would be a bad course for you. JP will challenge you to improve your coding skills and your life. Not your idea of a good time? Stay home. If you are very weak in .Net, especially if you are new to it, wait. Learn more about the framework, delegates, generics, and unit testing...
  • DDD - Slides Visug Talk by Yves Goeleven

    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...
  • When DDD should be considered ? by Jérémie Chassaing

    This is a recurring question on the DDD yahoo group . And there was a simple explanation during the ParisJug talk . DDD is not a silver bullet for all application development, it just helps to manage complexity when the complexity comes from the domain. No need for DDD when working on a technical application or a small application with few interactions. You could benefit from DDD when your application looks like the Cargo sample : Route containers based on transports availability Take cost and time into account Know where are the boats Organize loads and unloads Manage container storage (emit order of missions for employees on site) Provide container tracking and tracing to clients Transports can be late, manage it Transports can be canceled, manage it Contracts can be changed, destination can change Containers can be incorrectly routed even if emitted orders where correct, manage it. Manage taxes Manage time zones Manage currencies Manager constraints and local rules on dangerous containers contents In this kind of application, the complexity doesn’t come from an Xml web service or a database schema. Even without taking account any technical concern, it is complex ! So there is a simple rule of thumb to know if DDD could apply (independently...
  • Met Eric Evans at ParisJug by Jérémie Chassaing

    The ParisJug organized a DDD event yesterday in Paris presented by Eric Evans, the author of Domain Driven Design himself. He’d come in France ten years ago, but never made a presentation about Domain Driven Design here yet. Thanks to Antonio and Nicolas and the others and who organized this presentation in 4 days . You can find a summary of the talk in French here . Putting the model to work It was the title of the talk. I’ll not make a full report since it was mainly what’s in the book for those who had not grasped the concepts of DDD yet. I’ll talk about important topics of the content in following posts. Diner with Eric Evans and Jug guys After the presentation, we moved to a restaurant with Eric Evans, the organizers and other attendees. I had the chance to be at the same table as Eric, so I had the opportunity to talk with him about a lot of things. He’s not at all the Pattern Guru kind. Very careful to let you understand he’s not found a solution to your problems, that you’ll have to work, but that his experience and analysis can help to grasp things a bit more clearly. He’s constantly working hard on several project to get more experience and set his knowledge and experimentation against different contexts. I’ll also talk about...
  • Programming Basics: The for loop can do more than increment an integer by jcteague

    This is one of those small things that is easy to forget. Usually when we use a for loop, we'll just incrment over an integer so that we can get a specific item out of some iteration. But you can do much more than that. My current project has a complicated scheduling component and I'm often working with a range of dates. I often need to do something with the days between two dates. I created a TimePeriod class that is created with a start and end date. public class TimePeriod { private readonly DateTime _start; private readonly DateTime _end; public TimePeriod(DateTime start, DateTime end) { _start = start; _end = end; } ... } Now what I need to do is iterate over all of the days that are between these two dates. I was struggling with this for a while, trying get a clean implementation. Then I remembered that the for loop could do this for me. Instead of using the standard i++ of the loop action, I add a day to the iteration variable. Now I can get every day between the start and end date. public IEnumerable<DateTime> DaysInPeriod() { for(var d = _start; d <= _end; d = d.AddDays(1)) { yield return d; } } Once I had this in place, I was able to put on some more convenience methods to cut down on some repetitive tasks...
  • Some quick updates by chadmyers

    I know I’ve been remiss in my blog posting duties. Please trust me when I say it’s for good reason and that you’d understand. I appreciate you sticking with me. In the meantime, here are a few tidbits that you might find worth noting: Announcing: Zen Nate Kohari (whom I’d like to call a friend, though I’m not sure he feels the same way, lol) has just announced the coming-out party of a skunk-works project he and his wife Nicole   have been cooking up for quite some time now. It’s a lightweight (but powerful) lean project management system using Kanban. Nate can describe it better, so I’ll let you hear it straight from him: Zen Home Page:  http://agilezen.com Nate’s Blog post: http://kohari.org/2009/06/09/zen-and-the-art-of-project-management/ Side note: I’m taking votes for who has more attractive eyewear Nate or Nicole.   Steven Bohlen speaking for VAN on DDD Zachariah Young wanted me to let ya’ll know that Steven Bohlen (of “ Summer of NHibernate ” and “Streaking through campus naked” fame) will be presenting about Domain-driven Design at the next VAN (June 10). The details for attending are here (I suggest you check it out!): http://zachariahyoung.com/zy/post/2009/06/08/Introduction-to-DDD-with-Steve-Bohlen-on-June...
1 2 Next >