Introduction

Object-oriented patterns are a staple of modern software engineering. In this chapter, we’ll take a look at some of the most common ones and the problems they solve. Then we’ll introduce more functional solutions that solve the same sorts of problems that the object-oriented patterns solve.

For each pattern that we introduce, we’ll first look at it in Java. Then we’ll look at a Scala approach that solves the same problems, and finally we’ll wrap up with a look at a Clojure version that does as well.

Sometimes the Scala and Clojure replacements will be quite similar. For instance, the Scala and Clojure solutions in both Pattern 1, Replacing Functional Interface, and Pattern 7, Replacing Strategy, are largely the same. Other ...

Get Functional Programming Patterns in Scala and Clojure now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.