Skip to content

Modules, Features and Slices

The module is the top-level namespace and maps to a bounded context. One module per file is the convention but not enforced.

module <Name>
[<layouts>]
[<features>]

Layout templates declared at module level are described in Screens.

Features are vertical slice groupings. They nest arbitrarily deep for sub-features.

feature <Name>
[feature <Name>]* ← sub-features
[slice <type> <Name>]+

The slice is the atomic unit of behavior, aligned with Event Modeling. A slice has a type and a name, and contains the constructs that implement the behavior.

slice <SliceType> <Name>
<constructs>
TypeDescription
StateChangeA command → events flow; something that changes the system
StateViewA query + projection + screen; something that reads the system
AutomationA reactor or reducer; something that reacts to events
TranslateA capture; converts external data into events
ConstructTypical slice typePage
eventanyEvents
commandStateChangeCommands
constraintStateChangeConstraints
queryStateViewQueries
projectionStateViewProjections
screenStateViewScreens
reactorAutomationReactors
captureTranslateCaptures
module Invoicing
feature InvoiceManagement
slice StateChange RegisterInvoice
command RegisterInvoice
...
event InvoiceRegistered
...
slice StateView InvoiceList
query ListInvoices => InvoiceListReadModel[]
projection InvoiceList => InvoiceListReadModel
...
screen InvoiceList
...