Summary

In this chapter, we learned about structural design patterns and specifically about the following—adapter, decorator, bridge, composite, facade, flyweight, and proxy. We went through the details of each of them and showed a class diagram as well as a code example for each. Because of the richness of Scala, sometimes there can be a better implementation using some of the nice features of Scala, but sometimes the design pattern just looks the same as it would in a language such as Java.

In many cases, the structural design patterns seem quite similar. This, however, shouldn't confuse you as they still have different purposes. Some examples include:

  • Adapter versus Bridge: Adapter is used to convert one interface to another when we do ...

Get Scala Design Patterns - Second Edition 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.