Book Image

Learning Concurrent Programming in Scala

By : Aleksandar Prokopec
5 (1)
Book Image

Learning Concurrent Programming in Scala

5 (1)
By: Aleksandar Prokopec

Overview of this book

Table of Contents (18 chapters)
Learning Concurrent Programming in Scala
Credits
Foreword
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Index

Subjects and top-down reactive programming


Composing Observable objects is similar to composing functions, collections, or futures. Complex Observable objects are formed from simpler parts using functional composition. This is a very Scala-idiomatic pattern, and it results in concise and understandable programs.

A not-so-obvious downside of functional composition is that it favors bottom-up programming style. An Observable object cannot be created without a reference to another Observable object that it depends on. For instance, we cannot create an Observable object using the map combinator without having an input Observable object to call map on. In a bottom-up programming style, we build complex programs by implementing the simplest parts first, and then gradually working our way up. By contrast, in a top-down programming style, we first define the complex parts of the system, and then gradually divide them into successively smaller pieces. Top-down programming style allows first declaring...