Indigo application concerns
I recently read Yasser Shohoud's article about creating Indigo applications using the PDC Whidbey bits, and it has me a little worried. I missed the PDC, and this article was really my first look at the details of writing code against Indigo.
In particular, I'm worried about the Service Framework (SFx)-level client APIs. One of the beauties of the ASMX/Web Reference model in .NET 1.x was its simplicity - especially for clients. At first look, the SFx programming model isn't nearly as Mort-friendly as the Web Reference model. For example, we've gone from this:
HelloService service = new HelloService();
Console.WriteLine(service.Greeting("Indigo client"));
to this (using Yasser's example):
ServiceEnvironment se = ServiceEnvironment.Load();
ServiceManager sm =
se[typeof(ServiceManager)] as ServiceManager;
se.Open();
Uri uri = new Uri("soap.tcp://localhost:46001/HelloService/");
IHelloChannel channel = (IHelloChannel)sm.CreateChannel(
typeof(IHelloChannel), uri);
Console.WriteLine(channel.Greeting("Indigo client"));
Console.WriteLine("Press enter to exit");
Console.ReadLine();
se.Close();
This is not what I would consider a very Mort-ly API. In fact, I'm worried that many of my company's customers would run screaming if they saw that bit of sample code. These are not dumb people - they're just trying to build applications that solve business problems, not necessarily build infinitely scalable multi-stage web service pipelines. Many of these people are coming from the VB6 environment, which was (and probably still is) the primary development environment for internal corporate Windows applications for many years. Heck, a lot of these people are still trying to get their heads around inheritance, and interface based programming was hidden well enough by VB6 that even though they could do it, they mostly didn't.
I agree that ASMX hides too much both the server and client. There are times that I very much miss the fact that I don't have access to the underlying XML. But looking at that sample makes me think that maybe Indigo has gone too far the other way. If it's too complex, the average corporate developer won't embrace it. Imaging how COM would have fared if VB6 hadn't spared the average corporate developer from the complexity of IDL, proxy/stubs, event sinks, etc.
As I said, my expose to Indigo is minimal thus far, so perhaps I just don't understand the model well enough (I'm still fuzzy on the scope of ServiceEnvironments, for example). Or perhaps VS.NEXT will hide some of that complexity in the next incarnation of the Web Reference. But right now I'm left wishing for a little more country, a little less rock and roll.