03 December 2019

Pipeline Pattern

Many times we need to implement a workflow/pipeline in our code (i.e.: Java) this brings us bad design by using too many nested loops, if/switch, etc.

One way is to use a BPM however this has boilerplate config/code, a leaner solution is to implement Pipeline Pattern:

Definition of the Pipeline Pattern

 Each of the sequence of calculations is performed by having the first stage of the pipeline perform the first step, and then the second stage the second step, and so on.
 As each stage completes a step of a calculation, it passes the calculation-in-progress to the next stage and begins work on the next calculation.”


https://www.cise.ufl.edu/research/ParallelPatterns/PatternLanguage/AlgorithmStructure/Pipeline.htm

This is almost the same than:

Pipeline, Pipes and filters:

https://www.enterpriseintegrationpatterns.com/patterns/messaging/PipesAndFilters.html

https://www.codeproject.com/articles/1094513/pipeline-and-filters-pattern-using-csharp




gist:
https://stackoverflow.com/questions/39947155/pipeline-design-pattern-implementation

No comments :

Blog Archive

Disclaimer

The views expressed on this blog are my own and do not necessarily reflect the views of Oracle.