Svaťa Šimara
Nov 21, 2022

--

> i.e. they must not require the services in constructor nor as arguments of their methods.

I disagree with this. Pass to arguments whatever You need (things that are in the same software layer)

> Btw. The ProductPrices seems to me like a Repository. Would you also pass RepositoryInterface when needed in any Entity method?

It is similar to repository, but Repository have usually more responsibilities. Short answer - yes, if needed. But if You really need to do such thing, maybe think twice - You may end up with strangely coupled code.

--

--

Svaťa Šimara
Svaťa Šimara

Written by Svaťa Šimara

Developer interested in Domain-Driven Design & Modeling

No responses yet