Trade-offs

Benefits

Flexibility by Filter Exchange

Filters have a simple interface that allows their easy exchange within a processing pipeline. [1]

Flexibility through Composability

This major benefit, combined with the reusability of filter components, allows you to create new processing pipelines by rearranging filters or by adding new ones. [1]

A pipeline without a data source or sink can be embedded as a filter within a larger pipeline. [1]

Rapid prototyping of pipelines

Reusability and Composability make it easy to prototype a data-processing system from existing filters. [1]

Drawbacks

Sharing state information is expensive or inflexible

If your processing stages need to share a large amount of global data, applying the Pipes and Filters pattern is either inefficient or does not provide the full benefits of the pattern. [1]

Data transformation overhead

A long chain may face certain amount of overhead because the data transmission. If we are using a long chain of filters, we are paying for the gain in flexibility with potentially lower performance due to repeated message transmission.


References

  1. Buschmann, F., Meunier, R., Rohnert, H., Sommerlad, P., & Stal, M. (1996). Pattern-Oriented Software Architecture Volume 1: A System of Patterns. https://dl.acm.org/citation.cfm?id=249013&bw=1

Last updated