Skip to content

Commit 3c4ae6c

Browse files
committed
Update README.md
1 parent 9ff4238 commit 3c4ae6c

File tree

1 file changed

+19
-11
lines changed

1 file changed

+19
-11
lines changed

pipeline/README.md

+19-11
Original file line numberDiff line numberDiff line change
@@ -9,27 +9,32 @@ tags:
99
---
1010

1111
## Intent
12-
Allows processing of data in a series of stages by giving in an initial input and passing the processed output to be
13-
used by the next stages.
12+
13+
Allows processing of data in a series of stages by giving in an initial input and passing the
14+
processed output to be used by the next stages.
1415

1516
## Explanation
1617

17-
The Pipeline pattern uses ordered stages to process a sequence of input values. Each implemented task is represented by
18-
a stage of the pipeline. You can think of pipelines as similar to assembly lines in a factory, where each item in the
19-
assembly line is constructed in stages. The partially assembled item is passed from one assembly stage to another. The
20-
outputs of the assembly line occur in the same order as that of the inputs.
18+
The Pipeline pattern uses ordered stages to process a sequence of input values. Each implemented
19+
task is represented by a stage of the pipeline. You can think of pipelines as similar to assembly
20+
lines in a factory, where each item in the assembly line is constructed in stages. The partially
21+
assembled item is passed from one assembly stage to another. The outputs of the assembly line occur
22+
in the same order as that of the inputs.
2123

2224
Real world example
2325

24-
> Suppose we wanted to pass through a string to a series of filtering stages and convert it as a char array on the last stage.
26+
> Suppose we wanted to pass through a string to a series of filtering stages and convert it as a
27+
> char array on the last stage.
2528
2629
In plain words
2730

2831
> Pipeline pattern is an assembly line where partial results are passed from one stage to another.
2932
3033
Wikipedia says
3134

32-
> In software engineering, a pipeline consists of a chain of processing elements (processes, threads, coroutines, functions, etc.), arranged so that the output of each element is the input of the next; the name is by analogy to a physical pipeline.
35+
> In software engineering, a pipeline consists of a chain of processing elements (processes,
36+
> threads, coroutines, functions, etc.), arranged so that the output of each element is the input
37+
> of the next; the name is by analogy to a physical pipeline.
3338
3439
**Programmatic Example**
3540

@@ -88,14 +93,17 @@ And here's the `Pipeline` in action processing the string.
8893
```
8994

9095
## Class diagram
96+
9197
![alt text](./etc/pipeline.urm.png "Pipeline pattern class diagram")
9298

9399
## Applicability
100+
94101
Use the Pipeline pattern when you want to
95102

96-
* Execute individual stages that yields a final value
97-
* Add readability to complex sequence of operations by providing a fluent builder as an interface
98-
* 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)
103+
* Execute individual stages that yields a final value.
104+
* Add readability to complex sequence of operations by providing a fluent builder as an interface.
105+
* Improve testability of code since stages will most likely be doing a single thing, complying to
106+
the [Single Responsibility Principle (SRP)](https://java-design-patterns.com/principles/#single-responsibility-principle)
99107

100108
## Known uses
101109

0 commit comments

Comments
 (0)