context-mapper-dsl icon indicating copy to clipboard operation
context-mapper-dsl copied to clipboard

New validator for references across BC boundaries

Open stefan-ka opened this issue 5 years ago • 1 comments

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)

stefan-ka avatar Mar 17 '20 13:03 stefan-ka

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.

stefan-ka avatar Sep 23 '20 13:09 stefan-ka