* #496 Add pipeline module to parent pom ✨ * #496: Add main application class and test for pipeline * #496: Checkstyle format and add log messages on pipeline stages 🎨 * #496: Fill readme sections of pipeline ✨ * #496: Javadocs and checkstyle formatting 🎨 * #496: Follow PMD checks and add more explanation as block comment on App.java * #496: Apply requested PR changes by iluwatar 🎨
37 lines
1.5 KiB
Markdown
37 lines
1.5 KiB
Markdown
---
|
|
layout: pattern
|
|
title: Pipeline
|
|
folder: pipeline
|
|
permalink: /patterns/pipeline/
|
|
categories: Behavioral
|
|
tags:
|
|
- Java
|
|
- Functional
|
|
- Difficulty-Intermediate
|
|
---
|
|
|
|
## Intent
|
|
Allows processing of data in a series of stages by giving in an initial input and passing the processed output to be used by the next stages.
|
|
|
|
## Applicability
|
|
Use the Pipeline pattern when you want to
|
|
|
|
* execute individual stages that yields a final value
|
|
* add readability to complex sequence of operations by providing a fluent builder as an interface
|
|
* improve testability of code since stages will most likely be doing a single thing, complying to the [Single Responsibility Principle (SRP)](https://java-design-patterns.com/principles/#single-responsibility-principle)
|
|
|
|
## Typical Use Case
|
|
|
|
* implement stages and execute them in an ordered manner
|
|
|
|
## Real world examples
|
|
|
|
* [java.util.Stream](https://docs.oracle.com/javase/8/docs/api/java/util/stream/package-summary.html)
|
|
* [Maven Build Lifecycle](http://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html)
|
|
* [Functional Java](https://github.com/functionaljava/functionaljava)
|
|
|
|
## Credits
|
|
|
|
* [The Pipeline Pattern — for fun and profit](https://medium.com/@aaronweatherall/the-pipeline-pattern-for-fun-and-profit-9b5f43a98130)
|
|
* [The Pipeline design pattern (in Java)](https://medium.com/@deepakbapat/the-pipeline-design-pattern-in-java-831d9ce2fe21)
|
|
* [Pipelines | Microsoft Docs](https://docs.microsoft.com/en-us/previous-versions/msp-n-p/ff963548(v=pandp.10)) |