context-mapper-dsl
context-mapper-dsl copied to clipboard
New validator for references across BC boundaries
From a domain object in a CML model it is currently possible to reference any other domain object.
I suggest to implement a validator which ensures that references to another Bounded Context are only possible if the referenced domain object is part of an exposed Aggregate of a corresponding Context Map relationship (exposed Aggregates). In other words: a domain object reference shall only be possible if there is a relationship on the Context Map that makes the referenced object available to the context containing the reference.
(references should also be possible if there is a Shared Kernel or Partnership relationship between the contexts)
With v6.0.0 we have at least a warning now: https://contextmapper.org/news/2020/09/23/v6.0.0-released/
Maybe we can change to an error in a future release.