Summary

Throughout this chapter, we explored two lazily evaluated collections that are provided by the standard Scala library: views and streams. We explored their characteristics and implementation details, as well as the limitations to bear in mind when using these abstractions. Leveraging your newly-acquired knowledge, you addressed a critical performance problem affecting MVT clients trying to view their performance trend.

In the Stream sections, we took the opportunity to tie the concept of stream processing to event sourcing. We briefly explored the event sourcing paradigm and introduced a simple event-driven transformation pipeline to improve the architecture of the reporting system and to define a stronger domain model. Lastly, we built a Markov chain event generator to exercise our new approach to generating reports.

By exploring both eager and lazy collections, you now possess a strong working knowledge of the collections that are provided by the Scala standard library. In the next chapter, we will continue our exploration of Scala concepts viewed through the functional paradigm by diving into concurrency.

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

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