Implementing an Idiomatic Service DSL

With the solid foundation we created, it shouldn’t be too hard to implement a straightforward DSL for services; however, in many ways the design of the API is a harder problem, and much more a matter of taste than engineering. In this case our limitations can guide us. Since our limited space and scope prevent us from pursuing more elaborate options like macros and complex base traits, we can instead focus on a thoughtful arrangement of basic Scala patterns: case classes, method chaining, and implicits.

Designing a Service

We’ll again rely on Argonaut for serialization and deserialization. As you saw in the previous section, our Response class can hold any kind of value, but we need a good way to transform ...

Get Modern Systems Programming with Scala Native now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.