Anastasia Lysenko
1 min readJun 12, 2018

--

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!

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Anastasia Lysenko
Anastasia Lysenko

Written by Anastasia Lysenko

Experienced developer, team lead and architect, who see the patterns everywhere and love to keep code in well-documented, clean and organized shape.

Responses (1)

Write a response