Monthly Archives: August 2008

One of those days

I had one of those days the other day.  Not quite a case of the Mondays, but one where I thought maybe I should just go home and start over.  If you’re trying to get this test to pass: [Test] … Continue reading 

Posted in Rant | 4 Comments

Strategies and discriminators in NHibernate

I recently posted about enumeration classes, and how I like to use them as a sort of “Enumerations with behavior”.  Not every enumeration should be replaced with a class, but that pattern helps quite a bit when I find a … Continue reading 

Posted in NHibernate, Patterns | 14 Comments

Parameter lists in NHibernate

Occasionally I need to return a set of entites that match a collection of parameters.  In SQL, I would use the “IN” clause, then manually create each parameter in ADO.NET.  With NHibernate, that’s not necessary anymore.  NHibernate has built-in capabilities … Continue reading 

Posted in NHibernate | 10 Comments

Services in Domain-Driven Design

Services are first-class citizens of the domain model.  When concepts of the model would distort any Entity or Value Object, a Service is appropriate.  From Evans’ DDD, a good Service has these characteristics: The operation relates to a domain concept … Continue reading 

Posted in Domain-Driven Design | 18 Comments

DDD, Repositories and ORMs

One of the confusing aspects of those new to DDD is the concept of a Repository.  From Fowler’s Patterns of Enterprise Application Architecture, a Repository: Mediates between the domain and data mapping layers using a collection-like interface for accessing domain … Continue reading 

Posted in Domain-Driven Design | 28 Comments

On good design and defining success

This is for the most part a reaction to conversations on design: Testability in .Net Design and Testability Good Design is not Subjective Believe it or not, I largely agree with all of these posts.  The conversation originally started around … Continue reading 

Posted in Agile, Design | 2 Comments

Convention, configuration and WCF

Convention is something that’s fairly lacking in WCF.  Here’s what I’d like to do: [ServiceContract] public interface ICustomerSearch { Customer FindCustomerByName(string name); } public class Customer { public string Name { get; set; } public CustomerType Type { get; set; … Continue reading 

Posted in WCF | 8 Comments

Austin DDD Book Club wrapped up

The last Austin DDD Book Club meeting came and went today, finishing up with the last couple of chapters in Evans’ excellent Domain-Driven Design book (covering Chapter 17, Bringing the Strategy Together and the Conclusion).  I want to thank our … Continue reading 

Posted in Austin DDD Book Club, Domain-Driven Design | 4 Comments

Deferred execution gotchas

I was trying to be clever the other day and try to chain assertions on an array: [Test] public void This_does_not_work() { var items = new[] {1, 2, 3, 4, 5}; items .Each(x => x.ShouldBeLessThan(0)) .Each(x => x.ShouldBeGreaterThan(10)); } I … Continue reading 

Posted in C#, LINQ | 2 Comments

Enumeration classes

A question came up on the ALT.NET message board asking whether Value Objects should be used across service boundaries.  Of course, the conversation took several detours, eventually coming to the question, “what do you do about enumerations crossing service boundaries.”  … Continue reading 

Posted in C#, Domain-Driven Design | 53 Comments