Modules, Features and Slices
Module
Section titled “Module”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
Section titled “Features”Features are vertical slice groupings. They nest arbitrarily deep for sub-features.
feature <Name> [feature <Name>]* ← sub-features [slice <type> <Name>]+Slices
Section titled “Slices”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>Slice types
Section titled “Slice types”| Type | Description |
|---|---|
StateChange | A command → events flow; something that changes the system |
StateView | A query + projection + screen; something that reads the system |
Automation | A reactor or reducer; something that reacts to events |
Translate | A capture; converts external data into events |
What goes in a slice
Section titled “What goes in a slice”| Construct | Typical slice type | Page |
|---|---|---|
event | any | Events |
command | StateChange | Commands |
constraint | StateChange | Constraints |
query | StateView | Queries |
projection | StateView | Projections |
screen | StateView | Screens |
reactor | Automation | Reactors |
capture | Translate | Captures |
Example
Section titled “Example”module Invoicing
feature InvoiceManagement
slice StateChange RegisterInvoice command RegisterInvoice ... event InvoiceRegistered ...
slice StateView InvoiceList query ListInvoices => InvoiceListReadModel[] projection InvoiceList => InvoiceListReadModel ... screen InvoiceList ...