I have a set of services (non-WCF) that sit on queues. When message arrives, typical service does some calculations and spits out zero or more result messages to its output queue. Besides its primary function, each service has some housekeeping logic like auth / audit / logging / status tracking with exact steps and sequencing varying somewhat between the services. This is where the notion of pipeline enters the picture.
I'm not happy with the design we ended up with, and looking for ways to simplify it. Should I model after CCR ports? ASP.NET pipeline? AOP? Anything else?
My current design is as follows: I have an IMessageHandler<TMessage>
interface and about 15 implementations that are chained together in 6 unique ways using IoC. The interface defines single method, Handle(TMessage msg), so each implementation can do some logic both before and after passing the message over to the next handler in the daisy chain.
The problem with this is: it's kind of hard to remember what exactly each implementation does and why they were chained this particular way for this particular service. On the other hand, having each aspect sit in its own class allows for better separation of concerns and therefore easier unit-testing.
Ideas? Any good pipeline patterns I can look at? Any nice pipeline implementations I can use as reference? Or should I JFHCI?