O'Reilly logo

Domain Modeling Made Functional by Scott Wlaschin

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required