Summary

Here we are at the end of our journey through the Scala design patterns. As you already know, design patterns exist in order to cope with a certain limitation of a language. They also help us to structure our code in a way that makes it easy to change, use, test, and maintain. Scala is an extremely rich language, and we focused on some of its features, which make it capable of achieving things, which other languages might not be able to do without any extra effort and knowledge.

We looked at the different Gang of Four design patterns from the point of view of Scala—creational, structural, and behavioral design patterns. We saw that some of them are not even applicable in functional languages and that others can be approached differently. We also saw that some design patterns still remain valid and knowing them is really important for any developer.

We can't talk about Scala without dealing with concepts such as monoids and monads. At first, they could be pretty scary and abstract and manage to put people off. So, we spent some time with them and showed their value. They can be used to write powerful applications in a purely functional way. They can be used to abstract and reuse functionality. By minimizing the dry theory and focusing on understandable examples, we hopefully made them much more approachable and usable for those of you who don't have a deep mathematical background.

Using the rich features of Scala opens up another large group of design patterns. We spent some time on design patterns that are possible just because of the way Scala works and the different features it provides.

Throughout the book, we have tried to provide meaningful examples, which can be used as a reference to find specific patterns and applications of the techniques we learned here. In this last chapter, we even implemented a complete application. On many occasions, we have tried to showcase how different design patterns can be combined together. Of course, in some cases, the concepts could be pretty complicated by themselves, so we simplified the examples.

We've given some advice about when to use certain design patterns and when to avoid them. These points should be extremely helpful to you in terms of what details to focus on.

The use of libraries has been encouraged throughout the book. Especially in the last few chapters, you have been exposed to quite a large number of interesting libraries, which can be easily added to your arsenal. We have hopefully also sparked an interest and a habit to always do checks before trying something new.

Finally, all the examples found in this book, can also be found online at https://github.com/nikolovivan/scala-design-patterns.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.189.180.43