January 2018
Beginner to intermediate
312 pages
7h 22m
English
We’ve created a lot of types in the chapter, so let’s step back and look at how they fit together as a whole, as a complete domain model.
First, we put all these types in a namespace called OrderTaking.Domain, which is used to keep these types separate from other namespaces. In other words, we’re using a namespace in F# to indicate a DDD bounded context, at least for now.
| | namespace OrderTaking.Domain |
| | |
| | // types follow |
Then let’s add the simple types.
| | // Product code related |
| | type WidgetCode = WidgetCode of string |
| | // constraint: starting with "W" then 4 digits |
| | type GizmoCode = GizmoCode of string |
| | // constraint: starting with "G" then 3 digits |
| | type ProductCode = |
| | | Widget of WidgetCode ... |
Read now
Unlock full access