How do you define abstractions over logical branching? How can you eliminate the Arrow Code anti-pattern? Can you compose two—or more—processes that each may produce a number of mutually exclusive outcomes?

Using object-oriented code, can you make illegal states unrepresentable?

This episode, the first of two connected videos, teaches you how to model mutually exclusive cases in a type-safe, object-oriented way. You’ll see lots of object-oriented code examples that illustrate how to amplify the essentials of domain-specific logical branching, while eliminating the irrelevant implementation details.

Finally, you’ll learn how such abstractions over logical branching corresponds to a well-known design pattern. Refactoring of the motivating code example shown in the video will be concluded in the next video.