A common headache in enterprise application integration:
How do you make messages sent from one system to another completely independant, extensible yet strongly typed?
By writing out Xml-messages and authoring tedious Xsd schemas to validate against? I guess that's one way to do it. If you got all the time in the world. Using my favorite C# compiler I did a small implementation of the Pipes and Filters pattern that have some interesting characteristics:
- Each filter and message type can be completely independant. So when upgrading a filter or extending a message the new versions are not required to inherit from the existing type.
- Two connected filters doesn't have to reference the same assembly that provides a common message type.
- Concrete filters are implemented using strongly typed .NET parameters. The base class acts as a transparent proxy. See below.
- Messages are piped in XML format, so a filter could be written in any programming language on any platform. Example filter implementation: [sourcecode language='csharp']class Filter1 : BaseFilter