Re: Repositories, package dependencies, and domain-flavoured exceptions



Nick Malik [Microsoft] wrote:
I think I understand what you are trying to say.

Here's how I read your problem:
You are restricting the use of your "domain" classes in an attempt to get strict adherance to seperating concerns (Kudos). However, you have a situation where the strict rules of dependency are reversed, in that the exception type itself has to be used by the "domain" class to generate an error that the "action" classes can understand... without running afoul of your enforcement mechanism.


(please correct me if I didn't get that right).

That's pretty much it.

I can see a couple of practical alternatives:
a) Always return a customer. By that, I mean that a search that would normally return "no customer found" would return a "null customer" that the other classes can understand.

I like this the best and considered it, but for pragmatic reasons, didn't go this route. Too late in the game...
.