Should I always go through the services when I try to follow DDD?
Or can I use a repository directly to get a domain object?
Personally, I don't like seeing repositories in controllers, or in the presentation layer in general. But I've seen it many times and there's nothing wrong with it in the context of DDD.
I think the answer is that it depends on how big your project is. A service layer is more often found in more complex projects. Whereas simpler MVC websites for example just use repositories directly.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With