July 2023
Intermediate to advanced
276 pages
6h 55m
English
With Java we have two powerful tools: the object-oriented approach and the functional style. They aren’t mutually exclusive; they can work together for the greater good.
In OOP we often mutate state. If we combine OOP with the functional style, we can instead transform objects by passing lightweight objects through a series of cohesive functions. This can help us create code that’s easier to extend—to produce a different result we simply alter the way the functions are composed. We can use the functions, in addition to the objects, as components to program with.
In this chapter we look into function composition. Then we use that to create a practical working example of the popular MapReduce ...
Read now
Unlock full access