java-design-patterns/collection-pipeline
Anurag Agarwal 33ea7335b1 Java 11 migration: patterns (remaining b-c) (#1081)
* Moves business-delegate pattern  to java 11

* Moves bytecode pattern  to java 11

* Moves caching pattern  to java 11

* Moves callback pattern  to java 11

* Moves chain pattern  to java 11

* Moves circuit-breaker pattern  to java 11

* Moves collection-pipeline pattern  to java 11

* Moves command pattern  to java 11

* Moves commander pattern  to java 11

* Moves composite pattern  to java 11

* Corrects test cases
2019-11-12 21:56:46 +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