Aleks Seovic
01-31-2006, 03:35 AM
How does everyone feel about allowing for pluggable message processors that could be used to transform request/response messages after serialization and before deserialization.
I guess it would be somewhat similar to SOAP extensions, except for the fact that it could be easily configured using Spring and that we would provide few standard processors out-of-the-box, such as XsltMessageProcessor for example, that would allow you to configure XSLT template to use, for example.
The reason I'm asking is that the more I'm thinking the more XSLT seems like the best solution for the message-to-domain mapping we discussed. It allows you to serialize your objects any way you want and then transform the serialized XML into the schema required by the target service. The same thing applies for response messages -- you can easily transform them into the schema required by your domain model.
A drawback is that some people (Mark included) don't like to use XSLT unless they absolutely have to, and shy away from anything that requires them to write it. I personally don't mind it, although I can't say it's one of my favorite things in the world. It does get the job done, though.
Another drawback is performance -- as we all know, XSLT is not the most performant technology around, but I don't think it would have a big impact in this case. Each template would be parsed only once, when the context is loaded, which solves the biggest performance problem with XSLT. Actually, I think that overall it might be faster than all the reflection and dynamic serializer type generation that is used by the standard .NET web services infrastructure.
However, there are benefits as well. Unlike custom serialization configuration schema that we might come up with, XSLT is a standard and there are good tools for it that would allow users to write and test their templates. In many cases, they also wouldn't have to learn one more new thing (and even if they do, XSLT, well, at least basic XSLT knowledge is a good tool in a developer's toolbox).
As you can probably see, I'm a bit torn on this one myself, so any feedback, opinions, suggestions, even flames telling me I'm out of my mind for even suggesting this would be highly appreciated. And of course, make sure that you vote for your preferred option above.
Regards,
Aleks
I guess it would be somewhat similar to SOAP extensions, except for the fact that it could be easily configured using Spring and that we would provide few standard processors out-of-the-box, such as XsltMessageProcessor for example, that would allow you to configure XSLT template to use, for example.
The reason I'm asking is that the more I'm thinking the more XSLT seems like the best solution for the message-to-domain mapping we discussed. It allows you to serialize your objects any way you want and then transform the serialized XML into the schema required by the target service. The same thing applies for response messages -- you can easily transform them into the schema required by your domain model.
A drawback is that some people (Mark included) don't like to use XSLT unless they absolutely have to, and shy away from anything that requires them to write it. I personally don't mind it, although I can't say it's one of my favorite things in the world. It does get the job done, though.
Another drawback is performance -- as we all know, XSLT is not the most performant technology around, but I don't think it would have a big impact in this case. Each template would be parsed only once, when the context is loaded, which solves the biggest performance problem with XSLT. Actually, I think that overall it might be faster than all the reflection and dynamic serializer type generation that is used by the standard .NET web services infrastructure.
However, there are benefits as well. Unlike custom serialization configuration schema that we might come up with, XSLT is a standard and there are good tools for it that would allow users to write and test their templates. In many cases, they also wouldn't have to learn one more new thing (and even if they do, XSLT, well, at least basic XSLT knowledge is a good tool in a developer's toolbox).
As you can probably see, I'm a bit torn on this one myself, so any feedback, opinions, suggestions, even flames telling me I'm out of my mind for even suggesting this would be highly appreciated. And of course, make sure that you vote for your preferred option above.
Regards,
Aleks