O'Reilly logo

Functional and Reactive Domain Modeling by Debasish Ghosh

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 3. Designing functional domain models

This chapter covers

  • Designing domain models—the functional and algebraic way
  • Decoupling the algebra of the domain from its implementation
  • Enforcing the laws of algebra in designing APIs
  • Implementing lifecycle patterns of domain objects

Previous chapters covered the parallels between functional programming and mathematics in general, and algebra in particular. You explored algebraic data types, sum types, and product types, and you learned how to combine them to form abstractions that model your domain elements. This chapter takes this discussion to the next level; you’ll begin with specifications of the model and, using algebraic composition of types, build APIs for our domain model. These ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required