Object-oriented event sourcing

Object-oriented event sourcing

This time, we’re going to refactor our solution towards an object-oriented (OOP) style. The finite state machine we implemented previously enables us to take advantage of polymorphic behaviour while sticking to immutability.

November 16, 2023 · 8 min · 1702 words · Jakub Zalas
Deriving state from events

Deriving state from events

In event sourcing, the state is derived from events that have happened in the past. In a classic approach, state is persisted while events are lost. In an event-sourced system, it’s the events that are persisted while state is derived.

November 10, 2023 · 11 min · 2176 words · Jakub Zalas
Mastermind game implemented with event sourcing

Functional event sourcing example in Kotlin

Let’s implement the Mastermind game with event sourcing. For now, we’re only focusing on the domain model.

November 3, 2023 · 18 min · 3734 words · Jakub Zalas
Functional event sourcing

Functional event sourcing

Let’s consider how functional domain model might work in practice by applying the event sourcing pattern.

October 19, 2023 · 9 min · 1817 words · Jakub Zalas
Functional Domain Model

Functional domain model

A functional domain model is made of pure functions and immutable types. As Domain Driven Design teaches us, it should be expressed in the language shared by everyone involved in the project.

October 13, 2023 · 6 min · 1108 words · Jakub Zalas
Contract and collaboration tests

Collaboration and contract tests

A collaboration test is an example of interactions between the subject of the test and its collaborators often replaced with test doubles. A contract test confirms assumptions made in test doubles.

August 16, 2022 · 5 min · 951 words · Jakub Zalas
On granularity of tests focused on behaviour

On granularity of tests focused on behaviour

A function is one of the smallest units of behaviour. Functions can be composed to build coarser behaviours. What granularity and altitude to test behaviours on?

May 17, 2022 · 4 min · 704 words · Jakub Zalas