Skip to content

Location Transparency

Jose San Leandro edited this page Apr 8, 2021 · 1 revision

= Proposal

Within aggregates, references to other entities shouldn't be using identifiers and accessing their repositories. Instead, when applying the events, we should "inject" a lazy proxy of the dependency, to ensure you cannot treat it as an aggregate. This would improve the flexibility when defining the limits of bounded contexts. If the entity belongs to another bounded context, synchronous logic become promises. The caller doesn't know.

Additionally, it would allow us to move repositories out of the domain (to which they don't belong anyway). Aggregates get built by PharoEDA, and references are resolved by lazy proxies, not repositories.

Clone this wiki locally