Domain modelling in object-oriented and functional programming, based on C# and F#
summary
Argues that domain modelling works better when code mirrors domain and incorrect states are unrepresentable, comparing C# and F# examples. Shows concrete models: policies, vehicles, movable black boxes, and engines, implemented with discriminated unions and records in F# versus classes and inheritance in C#. Demonstrates validation in constructors, the alternative of returning an error union instead of throwing, a function type for behavior (vehicle * distance -> vehicle), and how F# keeps many simple types in one file via type inference.
AI-written summary · about
chapters (10)
- 0:00Introduction and context
- 2:54Classical domain modeling
- 5:58Domain modeling limitations
- 9:34Principles of modeling
- 12:29OOP modeling implementation
- 15:45Functional programming basics
- 19:07FP modeling implementation
- 22:53Complex modeling scenarios
- 26:15Functional modeling details
- 29:47Final thoughts and Q&A
related talks
01h 05mFrom object oriented to functional domain modeling
48mObject modeling: Theory vs Practice. Round 1
58mDomain Driven Design (DDD) with Algebraic Data Types (ADT)
17mFunctional Domain Modeling with Gleam
29mSingle Value Objects: where DDD and Functional Programming Share Forces
52mFunctional Patterns in Domain Modeling
35mLife After Business Objects - Confessions of an OOP Veteran
01h 00mThe Glamour and Misery of the Domain
