Book Image

Scala Design Patterns

By : Ivan Nikolov
Book Image

Scala Design Patterns

By: Ivan Nikolov

Overview of this book

Scala has become increasingly popular in many different IT sectors. The language is exceptionally feature-rich which helps developers write less code and get faster results. Design patterns make developer’s lives easier by helping them write great software that is easy to maintain, runs efficiently and is valuable to the company or people concerned. You will learn about the various features of Scala and be able to apply well-known, industry-proven design patterns in your work. The book starts off by focusing on some of the most interesting features of Scala while using practical real-world examples. We will also cover the popular "Gang of Four" design patterns and show you how to incorporate functional patterns effectively. By the end of this book, you will have enough knowledge and understanding to quickly assess problems and come up with elegant solutions.
Table of Contents (20 chapters)
Scala Design Patterns
Credits
About the Author
Acknowledgments
About the Reviewer
www.PacktPub.com
Preface
Index

Chapter 8. Behavioral Design Patterns – Part 1

Our journey through the Scala design patterns has arrived at the family of behavioral design patterns. This group has more members than the others we already went through, so we will split it into two separate parts. In this chapter, we will focus on the following behavioral design patterns:

  • Value object

  • Null object

  • Strategy

  • Command

  • Chain of responsibility

  • Interpreter

This and the next chapter will give some clarity about what behavioral design patterns are, where they are useful, and how to implement them in Scala. We will be following a path similar to the previous chapters where we presented the patterns, showed a class diagram and a code example, and finally, gave a few hints about what to watch out for and where certain patterns are preferred to be used. Hopefully, you will get a feel of them and be able to confidently identify situations where they are applicable.