«
April 2003
»
Remoting Not Going Away
Thursday 24 April
I hadn't heard the rumor but it is good to see Remoting is not going away just as I start work on a new project which will make heavy use of Remoting (via Ingo Rammer).
Ingo also has an interesting article on the mechanics of leasing.
VoiceXML and ASP.NET
Wednesday 23 April
I've started work on a new project based on VoiceXML and ASP.NET. Co-ordinating the architecture/design work and then some coding. Should be interesting.
The use of .NET Remoting between processes on the same machine will be important. Don Box recently wrote:
.NET Remoting. Easily the most complete and flexible implementation of the ORPC/Quasi-AOP ideas first floated in DCOM, MTS, CORBA, and EJB.
I agree except for one detail: security. DCOM security may have been painful at times but you always got where you wanted eventually. .NET Remoting does not have any buillt-in support for security. I found a couple of samples on MSDN:
Microsoft.Samples.Security.SSPI
Microsoft.Samples.Runtime.Remoting.Security
The trouble is that they're samples and so I have to review the code and test them thoroughly before using them in a production system. Thats a lot of extra work. It would be much better if something like this was part of the Framework.
Locked in a Trunk
Wednesday 23 April
From yet another rant by Dave Winer:
Look at it this way. We're all locked in a trunk. You can't get out of the trunk by smearing ketchup on my tie. It won't make the guys driving the car lose any money. They can't even see into the trunk. It's locked, from the outside
That is almost as good as some of the Information Minister's better quotes. I unsubscribed from Scripting News a while ago but I now realize I was reading it the wrong way. Dave is in fact a one-man sitcom, a moody Don Quixote tilting at the rest of the (development) world. The only thing you must remember is not to implement any code based on his "specs". That is taking him too seriously.
Bloated RSS Feeds
Wednesday 16 April
I agree with Bill Kearney's continuing rant about bloated full-content RSS feeds. If you include the full content for each item, then every time a new item is added to the feed the content of every item already in the feed is effectively downloaded again. Of course this may not matter if you have plenty of spare bandwidth. But for some of us it might make a difference to our bandwidth costs.
I've written about this before but I'd like to see the raw content of each item accessible individually so that the aggregator need only load the content once. The RSS file would contain a link to the raw content in addition to the link to the full page containing the item. I don't know enough about the RSS schema to know if this is currently supported. I've not heard of any aggregators supporting a feature like this.
XML-RPC Web Handler
Monday 7 April
I should have spotted this one before. How do you build an IIS XML-RPC service without compiling any code and without messing around with config files? Simple, use a web handler file. Create a file with a .ashx extension, like the example below, and put the XML-RPC.NET assembly in a bin directory underneath where the .ashx file lives (or put it in the GAC). Then point your XML-RPC client at the URL for the .ashx file.
<!- file: MathService.ashx ->
<%@ WebHandler Language="C#" Class="MathService" %>
<%@ Assembly Name="CookComputing.XmlRpc" %>
using System;
using System.Web;
using CookComputing.XmlRpc;
public class MathService: XmlRpcService
{
[XmlRpcMethod("math.Add")]
public int Add(int A,int B)
{
return A + B;
}
[XmlRpcMethod("math.Subtract")]
public int Subtract(int A, int B)
{
return A - B;
}
[XmlRpcMethod("math.Multiply")]
public int Multiply(int A, int B)
{
return A * B;
}
[XmlRpcMethod("math.Divide")]
public int Divide(int A, int B)
{
if (B == 0)
{
throw new XmlRpcFaultException(1001, "Divide by zero");
}
return A/B;
}
}
Deriving the WebHandler class, MathService in this example, from XmlRpcService supplies the necessary implementation of the ProcessRequest and IsReusable methods of the IHttpHandler interface. The implementation of ProcessRequest then uses reflection to map incoming XML-RPC requests to the methods marked with the XmlRpcMethod attribute.
Don Box on His Books
Sunday 6 April
Don Box compares the three books for which he was the primary or lone author. Essential XML is his favourite, yet:
Essential XML is hands-down my favorite, yet it got blasted on Amazon
I've already commented here that I liked this book. Too many technical books just describe the surface of their subjects, not much more than glorified how-to manuals. I prefer books which explore the concepts behind the subject. Essential XML is one of those books.
Two questions come to mind: why the big delay in publishing Essential .NET, and what is the next book going to be about?
Continuations and VMs
Sunday 6 April
Squawks of the Parrot also has a couple of entries on Continuations and VMs, part one and two, and why they are difficult to implement with virtual machines. Since I discovered continuations a while ago I've been playing around with Scheme a fair amount and even got as far as implementing a couple of toy Scheme interpreters. The first used the .NET CLR call stack and came to a dead end when trying to implement continuations (as Dan mentions its not possible to copy and manipulate the call stack in the .NET or Java VMs); the second was heap-based maintaining call frames, etc, as objects on the heap. My inspiration for the latter was the heap-based model described in a dissertation by Kent Dybvig called Three Implementation Models for Scheme.
Closures and C#
Sunday 6 April
Squawks of the Parrot has some interesting posts on Parrot and virtual machines in general. In C# may do closures now and the following entry Dan questions whether C# supports closures. In one of the comments Sam Ruby points to an article at GotDotNet which describes the new features in a future version of C# including anonymous methods. These seem to be very similar to closures although I don't know enough in this area to say whether there are any subtle differences.
The article contains a paragraph on how anonymous methods are supported:
When an anonymous delegate is encountered, the C# compiler automatically converts the code in its scope of execution into a uniquely named function within a uniquely named class. The delegate in which the code block is stored is then set to reference the compiler-genarated object and method. When the delegate is invoked, the anonymous method block is executed via the compiler-generated method.
almostperfect points to a comment by Miguel Icaza (on an earlier Squawks entry) which mentions that no changes are required to the virtual machine and provides some code illustrations as to how this implementation of anonymous methods works. It reminds me of function objects in C++.
Jon Shute thinks that anonymous methods will make testing more difficult which may be true but I disagree with his point that the new feature only saves one line of code: if you are capturing a lot of state in the anonymous method (any of the class members, current method parameters, or local variables, i.e. potentially anything within scope where the anonymous method is defined) then you could be avoiding a lot of extra code.
Developing WMI Solutions Website
Sunday 6 April
I posted a few months ago about the book Developing WMI Solutions by Gwyn Cole and Craig Tunstall. They've since set up a website for the book. It has links to code samples and some articles.
WMI doesn't have a high profile but there is increasing use of it in each version of Windows and other server products, for example Exchange. Most people will be interested from an administrator's point of view but for anyone developing a product which needs administration it is worth looking into implementing a WMI provider.