Pattern-Oriented Software Architecture (3)--Pipelines and filters

Source: Internet
Author: User

Looked all night, and did not quite understand the pipe/filter. Common cases the Linux command pipeline is a good understanding, but coupled with the chaotic active/passive dynamic concept, it is not very good to understand. Take notes first, then review them later.


This is the 2nd kind of architecture to look at, not something to gain: a general paradigm that abstracts some common designs

1, the system structure is the key point of the process: split, define interface/format, fit, error handling

2, the advantages of attention: The degree of reuse " Considering the design of general changes is a major booster of excellent system deepening"


Overview

Pipelines and Filters (Pipes and Filters) provide a structure for systems that handle data flows 。 Each processing step is encapsulated in a filter component, and the data is transported through a pipeline between adjacent filters. The reorganization filter can establish the related system family.
The "Details" example--the parsing process of the Java language (lexical analysis, parsing, semantic analysis, intermediate code generation, Intermediate code optimization) context--dealing with data flow problems--there are different input data sources; To achieve the flexibility to rearrange steps in the future, you need to plan ahead , disconnected processing steps do not share information etc solutions--Divide the system tasks into several sequential processing steps. The structure--1, then the pipeline unit pulls out the output data from the filter (passive filter) 2, the front pipeline unit presses the new input data into the filter (passive filter) 3, the most commonly used, the filter works in the circulation way, Pulls its input data from the assembly line and presses its output data into the assembly line (active filter)
Filter, Duty: Obtain input data, execute 1 functions on its input data, supply output data pipeline to represent the connection between filters, Duty: Convert data, buffer data, synchronize active neighbor
Dynamic characteristics-Active Passive filter (not understand) the realization--1, in order to divide the system task into a series of processing phase 2, define the data format to be transmitted along each pipeline 3, decide how to implement each pipeline connection 4, design and implement filter 5, design error handling 6, set up a processing line
Resolved example--TCP/IP protocol known to use: Unix pipelining tasks: Program compilation, document creation effect-advantages: Not necessarily intermediate files, filter exchange/reorganization flexibility, reuse, rapid prototyping, parallel processing inefficient: Sharing state information expensive/inflexible, parallel processing efficiency is not high, Data conversion extra overhead, error handling

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Pattern-Oriented Software Architecture (3)--Pipelines and filters

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.