View Source on Github

Pipeline

Decoupling Behavioral

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.

Class diagram

alt text

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)

Typical Use Case

  • Implement stages and execute them in an ordered manner

Real world examples

Credits