Header Image

Renato Cavalcanti

Software Developer @ Lightbend

Renato is a software developer at Lightbend where he works in the Lagom Framework Team. Scala aficionado since 2009, he has been hacking in Scala and related technologies for fun and profit. He has a special interest for Event Sourcing/CQRS, DDD and Microservices Architectures. He's the founder of BeScala (Belgian Scala User Group), author of Fun.CQRS and maintainer of Lagom Framework.

The Ubiquitous Language in Functional Programming

Domain modelling in software is never pure. Next to the domain data and business logic there is a whole other universe of programing language constructs that we have to deal with (control structures, error handling, asynchronous computations, etc).

In Functional Programming in general and in Scala in particular, we have many data types that model general programming aspects. In DDD terms, we could say that they model the ubiquitous language of simple computations.

In this talk we will analyze a few well-known data types in Scala (Option, Either, Cats Validated, etc) and try to understand them from a Domain-Drive Design perspective. We also show some code samples to illustrate how they can be abused and how we can refactor them by creating new data types.