Programming to interfaces while mapping with Fluent NHibernate

I realise this is a diversion, and not an answer to your question (although I think mookid has got that covered).

You should really evaluate whether interfaces on your domain entities are actually providing anything of worth; it’s rare to find a situation where you actually need to do this.

For example: How is relying on IMessage any less coupled than relying on Message, when they both (almost) undoubtedly share identical signatures? You shouldn’t need to mock an entity, because it’s rare that it has enough behavior to require being mocked.

Leave a Comment