Hi all,
Did about 30 minutes worth of searching, found lots of relevant info, but none that addresses this particular concern, hope I'm not repeating a common question.
I would like to know what the general consensus is in regard to implementing infrastructure-related interfaces in domain types. Everything I've read about DDD leads me to believe that this is to be avoided, as this understandably detracts from the conciseness of the model.
I am, however, at a point where I'm uncertain as to how to work around this. Specifically, I've got a domain type that would be perfectly fine to use in my presentation layer, except that I'd like to display an instance of it in a control that requires it implements IComparable. I would rather not 'pollute' my type with an implementation of this interface.
I think (perhaps naively) my options are:
- Use a Data Transfer Object (DTO), have it implement the interface, and use an instance of that in my presentation layer.
- I'm vaguely familiar with the fundamentals of AOP - perhaps there's a suitable technique in this realm?
- Perhaps related to option 2 - code 'weaving'? I know very little of why/when to consider this, but am I bumping up against it now?
- Bite the bullet, and implement the bit of code that it takes to satisfy the contract.
- Some voodoo-magic I've never even heard of?
If anybody cares to recommend 2, 3, or 5 - could you point me in the direction of some reading material that might help get me started?
Thx in advance.