Hello, Adam!
Thanks for your article and thoughts! We also use this approach in our DDD project. But one DoctrineProductRepository in your example turns out to over 40 (structured in different contexts) in our. So we have over 40 almost identical
save(SomeEntity $e),
remove(SomeEntity $e),
findById(SomeEntityId $id),
etc, methods.
I’m totally disappointed (even terrified) of this ugly violation of DRY principle. I think, that it’d better to have one abstract Repository (with those methods) and one abstract Entity to use in methods.
What do you think about it? Thanks in advance!