Adam Quaile
1 min readJun 13, 2018

--

Hi

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.

--

--