DDD Academy
No upcoming sessions

Functional and Reactive Domain Modeling

Advanced
English

Your Instructors

Domain modelling has been the cornerstone of any application design and implementation. Domain driven design has been one of the primary ways of domain modelling that focuses on the problem domain and treats problem domain artifacts as first class citizens of the modelling 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 modelling with mutable objects and most of the current architectures in domain modelling 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 modelling, we define domain behaviours using pure functions, which are expression based, compositional and hence easier to reason about.

In this workshop we will discuss approaches of domain modelling 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.

Debasish Ghosh

Who should sign up

  • If you are an aspiring functional programmer with some working knowledge of Scala and interested to increase your horizons of applying the concepts of FP in designing domain models
  • If you are a practitioner of FP and want to explore the advanced concepts of algebraic modelling using monads, applicatives etc.
  • If you are an OO programmer with some knowledge of Scala and wondering what to expect from FP in Scala

What will you get out of it

Here are some of the ideas that you will get from the workshop:

    <li>Algebraic domain modelling</li>
    <li>Expression based programming</li>
    <li>Importance of interface-first design and decoupling of interface from the implementation</li>
    <li>Parametricity</li>
    <li>Patterns of functional programming using algebraic techniques</li>
    <li>Effects are patterns, side-effects are bugs - How to manage side-effects algebraically</li>
    <li>Reactive patterns in domain modelling</li>

Format of the workshop

  • 40% theoretical presentations (concepts, FP techniques, patterns, Scala)
  • 40% code walkthroughs demonstrating the above theory
  • 20% hands-on exercises
  • The above percentages can vary depending upon the profile of the participants

Participant Prerequisites

  • Basic understanding of functional programming
  • Basic knowledge of Scala
  • (Brownie Points) Functional programming in Scala

Details

Day 1

  • Introduction to functional domain modelling (with examples from Scala)
    • What is a domain model
    • Introducing Domain Driven Design (DDD)
      • Bounded Context
      • Domain Model Elements
      • Lifecycle of a domain object
      • Ubiquitous language
    • Thinking Functionally about the domain
      • Model behaviours as pure functions
      • Functions operating on data (inverse of how we think of OO)
      • Behaviour / Function composition
    • Managing side-effects
  • Introduction to Reactive Domain Modeling
    • The 3+1 view of the reactive model
    • Being responsive in the face of failures
    • Debunking the myth - “My model cannot fail”
  • Functional meets Reactive
    • Reactive and algebraic
  • Hands on examples to continue with the lectures

Day 2

  • Introducing a concrete problem domain model
  • Functional Domain Modelling in Scala - we will use the following features of Scala to implement the above domain model incrementally
    • Algebraic approach to domain modelling
    • Algebraic Data Types (ADTs) and Pattern Matching
    • Composition of functions to implement domain behaviours
    • Role of static types in domain modelling
    • Functional in the small OO in the large
    • Managing effects, failures, latency using reactive patterns
    • Lifecycle patterns of domain objects in the functional world (introduce how to design factories, aggregates, repositories and services using algebraic and functional approach)
  • Hands on examples to continue with the lectures

Day 3

  • Functional Patterns of domain models
    • Introducing common patterns like functor, applicative and monad and how we can use them in designing domain models
    • Evolution of an API with functions, types and patterns
    • Modularization of domain models
  • Hands on examples to continue with the lectures

Sessions & Booking

Upcoming Sessions

No upcoming sessions yet.

Get in touch and we'll keep you posted.

Book for your team

We can organise this workshop privately for your company, tailored to your domain.

Contact us

Stay in the Loop

Get notified about new workshops, early-bird discounts, and exclusive content on DDD, Architecture, and Software Design.

No spam, unsubscribe anytime. Join 5,000+ developers.