Skip to content

Add owner to BoundedContext (#161) - #386

Draft
stefan-ka wants to merge 1 commit into
feature/375-base-packagefrom
feature/161-bounded-context-owner
Draft

stefan-ka wants to merge 1 commit into
feature/375-base-packagefrom
feature/161-bounded-context-owner

Conversation

@stefan-ka

@stefan-ka stefan-ka commented Oct 19, 2026 •

Copy link
Copy Markdown
Member

Part of #161 (the issue stays open for the follow-up questions listed below).

Stacked on #385; the base branch is feature/375-base-package, so the diff only shows this feature.

Changes

  • Grammar: new optional owner attribute on BoundedContext (reference to a Bounded Context, = optional), like the existing owner on Aggregates:
    BoundedContext TicketSales implements FareSales {
      owner = FareProductTeam
    }
    
    BoundedContext FareProductTeam realizes TicketSales {
      type = TEAM
    }
    
  • Validator: the owner must be a Bounded Context of type TEAM (same message as for Aggregate owners).
  • Formatter: owner starts on a new line.
  • Tests: with and without =, and the validation error.

Not included (open questions from the issue)

  • Inheritance: Aggregates without an own owner do not inherit the context's owner (relevant for Split Bounded Context by Owners).
  • A contact/handle attribute on Teams (e.g. for CODEOWNERS generation).
  • Separate owners for code and language.
  • Merge Bounded Contexts keeps the owner of the context whose attributes are taken, like the other single-valued attributes.

owner was already a keyword (Aggregates), so no highlighting change in the VS Code extension is needed.

Docs: ContextMapper/contextmapper.github.io#107

@codecov

codecov Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 83.33333% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 91.8%. Comparing base (c1b9e4f) to head (4b1752c).

Files with missing lines Patch % Lines
...tmapper/dsl/validation/TeamSemanticsValidator.java 83.3% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@                    Coverage Diff                     @@
##             feature/375-base-package    #386   +/-   ##
==========================================================
  Coverage                        91.8%   91.8%           
- Complexity                       2233    2237    +4     
==========================================================
  Files                             211     211           
  Lines                            5950    5956    +6     
  Branches                          808     809    +1     
==========================================================
+ Hits                             5466    5472    +6     
  Misses                            230     230           
  Partials                          254     254           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

A Bounded Context can name the team that owns it:

  owner = FareProductTeam

As for Aggregates, the owner must be a Bounded Context of type TEAM.
@stefan-ka
stefan-ka force-pushed the feature/375-base-package branch from 0389a6f to c1b9e4f Compare October 20, 2026 21:55
@stefan-ka
stefan-ka force-pushed the feature/161-bounded-context-owner branch from 628a2fe to 4b1752c Compare October 20, 2026 21:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant