Structural Design Patterns

Pipes and Filters

Description

Decompose a task into smaller tasks that chain from one to another using a data stream.

Purpose

Pipes and filters allow classes to narrow their responsibility to just a small segment of the problem and pass what is left onto the next class. This chain of objects can be very modular such that they can be plugged in anywhere in the stream dynamically as needed.

Design

Use the output of one class to make the input of another in a chain.

Example

Autobot Robotics has some vision processing software. In this software, an image goes through several layers of preprocessing before it is handed to the final decoder.

Criticisms

This could be considered an enterprise, architectural, or a structural design pattern depending on the scale of the project.