Program Structure to achieve pipelining

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I am writing an application that contains a number of modules/classes,

Class A, Class B, Class C, Class D.

The structure of my program is like a pipeline.

i.e input comes into Class A is processed and then passed to Class B which
is processed and then passed to Class C which is processed and passed to
ClassD.

The performance of the app is very important so as soon as data is processed
in one module/class it should be passed to the next as quickly as possible to
be processed.

I'd appreciate any suggestions on how to achieve the above

Thanks In Advance,
Macca
 
The first thing that comes to mind is the SoapExtension class and how it uses
ChainStream and clones the input stream for forwarding on to the rest of the
SOAP "pipeline" infrastructure. At the least, it may give you some good ideas.
Peter
 
One option would be to make all classes inherit from Stream and implement
them as such. Then you can chain them like:

using(ClassA ca = new ClassA())
using(ClassB cb = new ClassB(ca))
using(ClassC cc = new ClassC(cb))
{
cc.Write(...);
}

And do the reverse on the other end.
 
Back
Top