Description
In the Streams section of the tutorial, the following is written:
Functions that take a Stream and return another Stream are often called 'stream adapters', as they're a form of the 'adapter pattern'. Common stream adapters include map, take, and filter.
The Wikipedia article for Adapter pattern reads:
An adapter allows two incompatible interfaces to work together. This is the real-world definition for an adapter. Interfaces may be incompatible, but the inner functionality should suit the need. The adapter design pattern allows otherwise incompatible classes to work together by converting the interface of one class into an interface expected by the clients.
My understanding, therefore, is that functions like map
, take
, and filter
(which are largely rooted in functional programming) wouldn't be forms of the adapter pattern (at most, map
might be since it can convert from one type to another). My understanding could be flawed, and that's fine. If that's the case, we should link to the Wikipedia article (or preferably a better resource) that explains what is meant by the "adapter pattern" in this tutorial. If these functions are actually not following the adapter pattern, my recommendation would just be to remove the part that says "as they're a form of the 'adapter pattern'" to prevent confusion.