DDD eXchange 2010 highlights

On Friday I attended DDD eXchange 2010, a one-day software conference here in London on Domain Driven Design. This years conference focused on two themes — architectural innovation and process — and I saw talks by Eric Evans, Udi Dahan, Greg Young, Ian Cooper and Gojko Azdic discussing their various aspects. Here are some of …

Guard Methods

In defensive programming, guard clauses are used to protect your methods from invalid parameters. In design by contract, guard clauses are known as preconditions, and in domain driven design, we use them to protect invariants — unbreakable rules that form assumptions about our model: Unfortunately, in examples like this, the true intention of the method …

Label your services!

Here’s a code snippet showing a little habit of mine — something I do to all my domain and application services: What’s in these base interfaces? Nothing. They are just labels, used to help make make object roles explicit: Why is this a good idea? It helps makes implicit concepts — e.g. this is a …

Back to basics: What is state?

If you’re a new developer, one term you’ll hear used a lot is state. I remember I struggled with the idea at first, so I thought I’d write a brief introduction to the concept of state, and how it is applied to a few design and testing principles. What is state? Let’s use me as …

Correctness vs Robustness

In programming, correctness and robustness are two high-level principles from which a number of other principles can be traced back to. Correctness Robustness Design by Contract Defensive programming Assertions Invariants Fail Fast Populating missing parameters Sensible defaults Getting out of the users way Anticorruption Layer Backwards-compatible APIs Robustness adds built-in tolerance for common and non-critical …