I was watching a lecture/conference speaker talking about reducing redundant code, when going from Service to Model in an Anemic model vs. the Rich model. But regardless of which I use, I end up with similar to same logic in my classes either way.
Whether I have:
I still have some database operation that I will inevitably use somewhere else that does a SELECT or INSERT with close to the same code, Anemic or Rich, in a Service or in the regular old OOP Class with behavior. I have an extra class for the service abstraction, but other than that I have the same code.
I have read the pros and cons and all that. I am not arguing one way or the other. I've done both. I will say the "Rich" one looks like textbooks and OOP, but I digress.
Does a Rich Domain Model (vs Anemic) reduce duplicate code?
Edit: Removed boilerplate code references.