Monday, 13 August 2012

Pipes & Filters Architectural Style

Pipes & filter is one of the architectural styles. An architectural style defines a vocabulary of components and connector types, and a set of constraints on how they can be combined.

Pipes and filter style shows components and filters connecting those components. Each component shows set of inputs and set of outputs. Each component performs some local processing on input to produce output. Here output is generated incrementally, so that output begins before input is consumed. In this style components are called as filters and connectors are called as pipes. 

Invariants: 
1.  Filter must be independent entity.

      2. Filter should not know the identity of neighbors. Means it should not share any of its state with other components.

This style generally shows two types of pipes, 
1.  Bounded  pipes:
Such pipes restrict the amount of data that can reside on pipe.
      2. Typed pipe:
Such pipes want well formatted or typed data. Means they will pass data between two filters if an only if it is well formatted or typed.


Advantages:
     1. Gives over all input output behavior of the system.
     2. Such systems are easy to maintain.
     3. Reuse is possible.
     4. Supports concurrent execution.
 

Disadvantages:
      1.  Not good for interactive systems.
      2.  Not good for incremental display updates.
      3.  It is very difficult to maintain correspondence between two or more separate but related streams.
   
      Applications:
One of the best the application is shell commands. Where output of one command can be passed to another command.



In this style you can give feedback too.

1 comment:

  1. It is good article post,it may help beginners a lot.

    ReplyDelete