That’s a good question, and ultimately you’ll know your domain better than me, but let me question whether it’s really as terrifying as you think.

Firstly, does it really violate DRY? Arguably not, if you agree that dry is not about code http://verraes.net/2014/08/dry-is-about-knowledge/

Secondly, if you truly have over 40 different concepts each requiring their own repository, do they really all share the same interface? I don’t know your domain, but often even when doing similar things in code, one repository might have find(BranchNo $branch) and another lookup (VehicleReg $reg). If they’re the same now, will they remain the same, or will you find yourself breaking the mould later on?

If you share an implementation, would you be sharing code across different DDD bounded contexts? Do you want to do this?

Have a think, and ultimately I can’t say w which is right for your application. I just wouldn’t say all repetition is inherently a terrible thing. There’s always tradeoffs.


PHP developer. http://t.co/olQvZ91Lo4

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store