Functional and Reactive Domain Modeling teaches readers how to think of the domain model in terms of pure functions and how to compose them to build larger abstractions. It begins with the basics of functional programming and gradually progresses to the advanced concepts and patterns needed to implement complex domain models. The book demonstrates how advanced FP patterns like algebraic data types, typeclass based design, and isolation of side-effects can make models compose for readability and verifiability.
On the subject of reactive modeling, the book focuses on higher order concurrency patterns like actors and futures. It uses the Akka framework as the reference implementation and demonstrates how advanced architectural patterns like event sourcing and CQRS can be put to great use in implementing scalable models. It offers techniques that are radically different from the standard RDBMS based applications that are based on mutation of records. It also shares important patterns like using asynchronous messaging for interaction based on non blocking concurrency and model persistence, which delivers the speed of in- memory processing along with suitable guarantees of reliability.
Table of Contents
Chapter 1 Functional domain modeling: an introduction
Chapter 2 Scala for functional domain models
Chapter 3 Designing functional domain models
Chapter 4 Functional patterns for domain models
Chapter 5 Modularization of domain models
Chapter 6 Being reactive
Chapter 7 Modeling with reactive streams
Chapter 8 Reactive persistence and event sourcing
Chapter 9 Testing your domain model
Chapter 10 Summary—core thoughts and principles