Skip to main content
Version: 0.4.0

KQ095 — contexts do not nest

Error · contexts-do-not-nest · Domains

A Component is in at most one bounded context, and no Domain marked bounded-context sits inside another.

A component is in two bounded contexts: it is marked bounded-context itself or sits in a marked module, monolith or platform, and a marked domain also holds the domain it is filed under, or two of those marks hold it. A domain marked inside another marked domain is reported even before anything is filed in it. Keep the mark on the one boundary whose model holds, and remove the other.

Examples​

A domain marked bounded-context inside another marked domain raises KQ095:

domain selling "Selling" bounded-context { domain pricing "Pricing" bounded-context }

With the mark on one of them, nothing is raised:

domain selling "Selling" bounded-context { domain pricing "Pricing" }

© 2026 Extenza Works. All rights reserved.