Functional and Reactive Domain Modeling

Debasish Ghosh

Published by



RRP £36.99
Reviewed by

Patrick Hill CEng MBCS CITP


10 out of 10

Object-oriented ideas have long influenced the approach to software design and implementation across many commercial application domains. Recently however, there is growing interest in the benefits of a more widespread adoption of functional programming approaches. These benefits include increased reuse and composability, ease of understanding and testing, improved scalability and so forth.

This book draws together ideas from the three fields of domain-driven design, functional programming and reactive programming to provide a detailed and insightful exposition of modern approaches to domain modelling and implementation.

Domain driven design concepts permeate the book, with examples drawn from a simplified banking domain. The book explores the relationships between domain driven design concepts, such as bounded contexts, ubiquitous language, values, aggregates, repositories and so forth and their mapping to design processes, functional models and programming constructs specifically implemented in Scala.

The book describes the development of functional models using immutable data structures expressed as algebraic data types and manipulated by APIs abstractly expressed as algebras over those types and concretely implemented by interpreters. In addition, the book describes practical implications of the functional programming concepts of building programs as expressions rather than sequences of imperatives and representing types of computation using functional structures such as functors, monoids and monads. Functional programming ideas are explored in terms of being pragmatic modelling and programming tools rather than as theoretical concepts.

The book goes on to describe reactive systems programming, using techniques from functional programming to compose reactive effects such as Futures, as well as describing the use of messages and Actors in developing non-blocking APIs. Stream processing is introduced as a core technique for building reactive systems and the book provides a detailed look at Akka Streams. A chapter also provides discussion of alternative persistence techniques which support reactive systems, including Command Query Responsibility Segregation and event sourcing.

Running to a little under three hundred pages, the book is detailed and fast paced, with lots of example code snippets supported by an online repository containing a full, working code as well as pointers to other references. To help the reader navigate and assimilate the subject matter, each chapter contains an introductory map of its content, and a useful summary of its key points.

This is a great book for readers who want to explore modern ideas in systems design and implementation, and is one which warrants detailed study. However, some prior knowledge of functional programming and Scala is required.

Further information: Manning

March 2017