design patterns - Difference between Layers and Pipes and filters? -


what difference between these 2 design patterns? seems similar me, 1 processing unit (layer or filter) data procession , pull / push data processing unit. unit n communicates n+1 , n-1 unit, there interfaces defining functionality 1 particular unit offers.

what difference?

edit: maybe 1 difference should data flow. in layers flow can top-down, bottom-up and/or communication between layers inside. in pipes , filters data flow starts @ unit 1 , goes unit n (not back).

organization wise may looks both layers , pipe , filters patters similar (one component taking input , passing result another) functionally not. architectural patterns.

if go definition:

pipes , filters pattern divide larger processing task sequence of smaller, independent processing steps (filters) connected channels (pipes).

while in layer pattern, each layer communicates adjacent layers , responsible processing of own, passing requests layer below , answering requests layer above it.

comparison:

the pipe , filter pattern allows system assembled small programs called filters whereas layered system 1 in different layers of system take care of specific function of system. 

a filter has input , output whereas each layer in layered architectural style package of software (or systems) has well-defined interface , few well-known dependencies within application.

the filters assembled chain in each filter gets data previous filter in chain, processes data, , passes data next filter in chain whereas in layered systems dataflow can bidirectional such requests of layer above fulfilled with or without of layers below it.

order may not matter. e.g. can authenticate message , filter contents of message, or can filter contents first authentication whereas in layered system order same , cannot interchanged.

hope helps.


Comments

Popular posts from this blog

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -

ubuntu - Selenium Node Not Connecting to Hub, Not Opening Port -