Reification and type-safety in a CQRS world
summary
Built a small Scala CQRS library called fun-secure that compares three concrete ways to glue domain ADTs, Commands and Events: type-parameter plumbing, type-member/type-projection companions, and a working path-dependent implicit trick that registers companion types into implicit scope. Backends include Akka and an in-memory interpreter so tests return pure events not Futures. The system validates event handlers before persisting to avoid invalid state, and supports commands emitting multiple events.
AI-written summary · about
chapters (18)
- 0:00Introduction
- 1:25The problem
- 2:46Secure as framework
- 6:00Reification
- 9:00Behavior
- 14:05Commands Behavior
- 15:40DSL
- 17:23Type Parameters
- 20:37Type projections
- 22:03Type rejection
- 25:33Type actions
- 26:43Type objects
- 30:25Pathdependent types
- 31:30Implicit scope
- 34:23Akka
- 36:10InMemory Backend
- 39:44Wrapup
- 43:39Command and events
related talks
33mArmored type safety with Iron
44mTelling the Truth with Types
46mFunctional CQRS in Kotlin
43mModern Application Architecture with Scala in Real Life
15mTypestate via Revocable Capabilities
01h 05mDDD, event sourcing and CQRS – theory and practice
41mArchitectures Using Functional Programming Concepts
24mScala Ecosystems: Lightbend vs Typelevel
