Domain Modeling Made Functional

Scott Wlaschin March 9-12, 2021
9:00 AM - 12:30 PM (MST)

Functional programming and domain-driven design might not seem to be a good match, but in fact functional programming can be an excellent approach to designing decoupled, reusable systems with a rich domain model. This workshop will show you why.

This will be a hands-on workshop designed for beginners in functional programming. We'll do lots of exercises and build some small projects that take us all the way from high-level design to low-level implementation.

Who is this for?

This workshop is aimed at software developers and it will be especially useful if you are learning functional programming – all concepts used in the workshop will be explained. Previous development experience is recommended. No prior knowledge of functional programming required.

What you will learn

  • The concepts of functional programming
  • How to represent the nouns and verbs of a domain using types and functions
  • How to decouple the pure domain logic from the outside world
  • How to ensure that constraints and business rules are captured in the design
  • How to represent state transitions in the domain model
  • How to build a business workflow from smaller components
  • How to handle errors as part of the domain

By the end of the workshop you'll know how to build working solutions with rich domain models, using only functional programming techniques.

Sessions 1 & 2

  • Overview of DDD principles
    • Event storming
    • The importance of bounded contexts
    • Persistence ignorance
    • Domain modelling with AND/OR
    • Exercises: Model some common domains

Sessions 3 & 4

  • Introduction to functional programming
    • Functions and types
    • Composition as the fundamental principle
  • Functional architecture
    • Bounded contexts and Functional architecture
    • Working with IO
    • Testing

Sessions 5 & 6

  • Domain Modeling with algebraic types
    • Records, choices, simple types (SCU), and functions
    • Modeling constraints, options
    • Making illegal states unrepresentable
    • Modeling states

Session 7

  • Error handling
    • Handling domain errors
    • Composing complex functions

Session 8

  • The functional toolkit
    • Monads. Monoids and More!


Previous development experience is recommended.

We will be using F# as our development language. No experience with F# is needed though.

Instructions on how to install F# will be provided before the workshop

About Scott Wlaschin

Scott Wlaschin is a developer, architect and author. He is the author of the popular F# site and the book "Domain Modeling Made Functional", published by Pragmatic Bookshelf.

Known for his non-academic approach to functional programming, Scott is a popular speaker and has given talks at Explore DDD, NDC, F# Exchange, DDD Europe, and other conferences around the world.