Pipes and Filters

from Wikipedia, the free encyclopedia

Pipes and filters ( also known as pipes-and-filters , also known as data flow systems) is an architectural pattern from the field of software development. It describes the structure for systems that process data streams .

Schematic structure of the pipes-and-filter pattern

construction

The picture shows a schematic representation of a system based on the Pipes and Filters pattern . The system is structured by several independent units:

filter
A filter is a processing step. Each filter has a data input and a data output. The incoming data is converted in each processing step . During the conversion, parts of the data can be removed, added or completely replaced. The type of conversion is determined by the filter.
Pipes
A pipe is a connection between the individual processing steps. The name can be described by the English term for pipelines ( pipes derived).

In the picture shown, a system is shown in which the data arrive on the left (data entry) and are processed in several steps. The result of the overall system is output again on the right (data output). The output of a processing step is also the input of the subsequent processing step. The result of the system is therefore dependent on the input; the dependency graph is linear.

The processing steps can always be rearranged. If, for example, three different filters are available, 15 different systems can be formed from them (assuming that a filter is used at most once):

  • 3-step systems: (1,2,3) (1,3,2) (2,1,3) (2,3,1) (3,1,2) (3,2,1)
  • 2-step systems: (1.2) (1.3) (2.1) (2.3) (3.1) (3.2)
  • 1-step systems: (1) (2) (3)

These 15 systems can also be referred to as a “family” of related systems.

This architecture has a number of advantages:

  • System expansions are possible by exchanging or renewing filters.
  • If a filter is viewed as a component of a system, the system is easier to adapt to different contexts than if the system consisted of a single large component.

variants

A variant of the pipes and filter pattern is the tee-and-join pipeline system. Here are some differences:

  • Several input and output channels are allowed per filter. This means that different independent data streams can be processed in relation to one another.
  • T-filters or T-pipes enable a data stream to be split or, conversely, to merge two data streams. The two data streams can then be further processed in parallel in different ways .
  • Data loops are allowed: The output of a filter can be fed back as input from a previous filter unit. Information contained in the input data can thus be processed again. This makes it possible, in particular, to form non-linear systems.

Individual evidence

  1. ^ Frank Buschmann, Regine Meunier, Hans Rohnert, Peter Sommerlad, Michael Stal: Pattern-oriented software architecture . A pattern system. Ed .: Addison-Wesley. 2nd Edition. 1998, ISBN 978-3-8273-1282-2 (English: Pattern-Oriented Software Architecture . Translated by Christiane Löckenhoff).