Functional and Reactive Domain Modeling by Debasish Ghosh
Domain modeling has been the cornerstone of any application design and implementation. Domain driven design has been one of the primary ways of domain modeling that focuses on the problem domain and treats problem domain artifacts as first class citizens of the modeling exercise. However the more popular domain driven design learning resources are based on object-oriented paradigms of Java or C#. Traditional mainstream languages like Java and C# primarily encourage modeling with mutable objects and most of the current architectures in domain modeling adopt the same approach. Shared mutable state is an anti-pattern and leads to brittle models especially in the face of concurrency.
Functional programming encourages design using pure functions, much like mathematics. The function depends on input and output arguments and does not share any mutable state with the context / environment. This makes functions safe for composition to form larger functions out of smaller ones. In the context of domain modeling, we define domain behaviors using pure functions, which are expression based, compositional and hence easier to reason about.
In this workshop we will discuss approaches of domain modeling using the paradigm of pure functional programming. We will use Scala, that offers the capabilities of functional and OO paradigms. The workshop will demonstrate how to harness both the capabilities of Scala to implement rich and functional domain models.