Modeling Workflows with Functions
We’ve now got a way to model all the data structures—the “nouns” of the ubiquitous language. But what about the “verbs,” the business processes? In this book, we will model workflows and other processes as function types. For example, if we have a workflow step that validates an order form, we might document it like this:
| type ValidateOrder = UnvalidatedOrder-> ValidatedOrder |
It’s clear from this code that the ValidateOrder process transforms an unvalidated order into a validated one.
Working with Complex Inputs and Outputs
Every function has only one input and one output, but some workflows might have multiple inputs and outputs. How can we model that? We’ll start with the outputs. If a workflow has an ...
Get Domain Modeling Made Functional now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.