Doug Purdy posted an interesting question a
couple of weeks ago regarding generics in the upcoming releases of .NET and what possible
impact they could have on the ASMX WebServices and Remoting models (with remoting
being the fairly obvious answer). Being an opinionated
and general trouble-making sould myself, I can't help but raise a few questions on
the matter :)
I think the presence of generics in ASMX sounds fairly interesting
from a theoretic point of view, but I can't help but wonder just how useful it would
be in the real world. Specially troublesome is thinking just exactly what it means
for the "describe-first-code-later" movement. How would you describe a service involving
parametric types? I'm obviously no WS expert, but I can't see an obvious answer
without at least partially loosing type information in the description.
One wacky thought that comes to mind is the idea of generics and webservices
intermingling to create meta-services: services that at one point in time
(most likely during a late portion of a design phase) get instantiated over
specific types so that the real service emerges. But if my worry above is
real, this would need to happen before the final service is described using
current tools. A meta-service would basically be composed of some sort of parameterized,
meta-message description for input and output messages, which themselves could
not be fully described using current tools.
In a sense, if we go down to the SOAP level, we can already do generics:
pass in whatever document we want (yes, with some restrictions, I know) within the
body of the message. The problem is description, really. And if we were to have such
a meta-service directly exposed somehow (which would imply some dynamic type
creation based on the message payload), something else would need to be added to the
message itself to "fill in the blanks", either through some sort of header, or with
embedded schema information (yuck!).
Again, I'm no expert here, so I might just be babbling, but I'm
not sure just how useful this would actually be....