Difference between revisions of "Selector"

From DocDataFlow
Jump to: navigation, search
 
(4 intermediate revisions by one user not shown)
Line 1: Line 1:
A selector is a [[Composite Adapter|composite adapter]].  
+
A selector is a [[Composite Adapter|''composite adapter'']].  
  
 
It manages a group of two or more 'sub-adapters'.
 
It manages a group of two or more 'sub-adapters'.
  
When it receives a granule through its input connection, it will use some internal programming logic to decide which the most appropriate target adapter is, and it will send the granule to one (and only one) of its sub-adapters.
+
When it receives a granule through its input connection, it will use the [[Granule Acceptance|''granule acceptance'']] mechanism to decide which the most appropriate target adapter is, and it will send the granule to one (and only one) of its sub-adapters.
 +
 
 +
The output connection of the selector serves as the 'default option': if none of the sub-adapters is prepared to accept a particular granule, then the granule is routed through the output connection of the selector.
 +
 
 +
[[File:selector.png|800px]]
 +
 
 +
The sub-adapters are in a sequential list; the position of a sub-adapter in the list is important.
 +
 
 +
The sub-adapters are tried out in sequence: the first adapter willing to accept a particular granule will be the one selected. Any subsequent adapters in the selector's sub-adapter list don't even get to 'see' the granule once it's routed to the selected sub-adapter.

Latest revision as of 23:19, 29 December 2013

A selector is a composite adapter.

It manages a group of two or more 'sub-adapters'.

When it receives a granule through its input connection, it will use the granule acceptance mechanism to decide which the most appropriate target adapter is, and it will send the granule to one (and only one) of its sub-adapters.

The output connection of the selector serves as the 'default option': if none of the sub-adapters is prepared to accept a particular granule, then the granule is routed through the output connection of the selector.

Selector.png

The sub-adapters are in a sequential list; the position of a sub-adapter in the list is important.

The sub-adapters are tried out in sequence: the first adapter willing to accept a particular granule will be the one selected. Any subsequent adapters in the selector's sub-adapter list don't even get to 'see' the granule once it's routed to the selected sub-adapter.