Chapter 4. Mapping from domain to toolkit

 

This chapter covers

  • Choosing reactive components to represent the domain
  • Designing a message protocol
  • Modeling system state
  • Scaling to many actors
  • Recovering from faulty actors

We believe that one of the best ways to learn is through the process of analogical reasoning—comparing the known with the unknown. An analogy is like a handle on a heavy bucket. Although you may still be able to pick up the bucket without one, your chore will be more difficult. The use of analogies in graduate school is quite common, especially in the disciplines of science and engineering. In these disciplines, an analogy is referred to as a succedaneum, which means substitute. The poet William Wordsworth captured it best:

Science appears as what in truth she is,

Not as our glory and our absolute boast,

But as a succedaneum, and a prop

To our infirmity.

To begin learning by succedaneum, we use a simple analogy to reason about and model an Akka-based reactive application, starting with what you’ve learned so far. As you work your way through the book, the complexity of the analogy increases step by step. With each increase in complexity, you learn a new reactive concept to evolve the application layer upon layer until the idea is complete. As a result of this learning style, you’ll be able to craft your design in a way that translates the theory into succinct code that’s easy to maintain and enjoyable to write.

4.1. Designing from a domain model

4.2. Becoming message-driven

4.3. Controlling actor state with messages

4.4. Increasing elasticity

4.5. Resilience

Summary