java-design-patterns/collection-pipeline
Leon Mak c8a481bb77 Add java 11 support for #987 (o-t) (#1051)
* Use java 11

* Use .of
- Replace Arrays.asList with List.of
- Replace HashSet<>(List.of()) with Set.of

* Formatting
2019-10-29 08:37:40 +02:00
..
2018-09-08 20:38:04 +05:30
2019-10-12 20:05:54 +03:00
2018-09-01 15:48:36 +05:30

layout, title, folder, permalink, categories, tags
layout title folder permalink categories tags
pattern Collection Pipeline collection-pipeline /patterns/collection-pipeline/ Functional
Java
Difficulty-Beginner
Functional

Intent

Collection Pipeline introduces Function Composition and Collection Pipeline, two functional-style patterns that you can combine to iterate collections in your code. In functional programming, it's common to sequence complex operations through a series of smaller modular functions or operations. The series is called a composition of functions, or a function composition. When a collection of data flows through a function composition, it becomes a collection pipeline. Function Composition and Collection Pipeline are two design patterns frequently used in functional-style programming.

alt text

Applicability

Use the Collection Pipeline pattern when

  • When you want to perform a sequence of operations where one operation's collected output is fed into the next
  • When you use a lot of statements in your code
  • When you use a lot of loops in your code

Credits