Quick note on Indigo <-> 1.1 asmx interop
I have just done some experimental interoperation between Indigo and 1.1 asmx. Here is the code I wrote. It worked fine so far. Enjoy.
using System;
using System.MessageBus;
using System.MessageBus.Transports;
using System.Serialization;
[DefaultDocumentElement(Name="Add", Namespace="
http://tempuri.org/")]
public class Add {
public int x;
public int y;
}
class App {
[STAThread]
static void Main() {
Port p = new Port();
Add a = new Add();
a.x = 1;
a.y = 2;
Message m = new Message(new Uri("
http://tempuri.org/Add"), a);
m.Encoding = new AsmxEncoding(System.Text.Encoding.UTF8);
ou.Send(m);
p.Close();
}
}
XML Information Set really betrayed us
Dare correctly pointed out that XML InfoSet clearly specifies the [character encoding scheme] as an attribute of the document information item. That is why I feel betrayed by the InfoSet. Other examples include [prefix] of the element and attribute information item. See
this working draft, compared to the
recommendation spec. Since the first book I have read about XML was
"Essential XML" by Box et, al, I may have been too naïve for the matter.
IntelliNetOffice is the sample using VSTO intensively
My
VSTO project has just
became public. It was really a fun to code it. The highlight of the code is how we can achieve all of the three features below:
a) call web services asynchronously,
b) store and read cached data so that calling web connection is not a requirement,
c) make a) and b) transparent to the client (caller) code so calling code does not have to be different to process a) or b).
Definitely, c) was the hardest part. I am afraid most readers can not read any description because it is written in Japanese, but I am sure most readers can read VB.NET code. Those of you who are curious enough,
here is the code.
Desperately seeking XPathDocumentContent
...and
the Architect revealed it will be in the next version of the matrix (I mean Longhorn).
It's about time to realize that XML is not a text
Why does someone still think that they have to write Unicode BOMs by themselves, digging deep inside XmlTextWriter.BaseStream and UnicodeEncoding.GetPreamble? Encoding hint in the XML declarations and Unicode BOMs are all about XML 1.0 thing, but WriteStartElement and WriteStartDocument are not. They are InfoSet thing, so they do not have anything to do with the serialization format. Think about
XmlNodeWriter for example. Why does XmlNodeWriter NOT have any constructor that have a parameter of type Encoding? Why does it always call XmlDocument.CreateXmlDeclaration with null as the second argument? [1]
[1]
Yes, I know. XmlDocument.CreateXmlDeclaration does not have to have a parameter named "encoding" either. XmlDocument is doomed anyway...
Revolutions
Last night we tided over what we had to tide over. It was must, for we have already seen I and II.
Generic properties and indexers... why not?
Why can't we:
public T this<T>[string ID] where T : Person { ... }
public T Person<T> where T : Person { get { ... } set { ... } }
...?
R2-D2, C-3PO, Darth Vader and me
Doug Purdy and Steve Swartz came to Tokyo
Many Japanese are so shy that they can't ask questions in front of many audiences. We worry that speakers won't understand our questions because of our wrong accent. We worry that our questions might sound too novice. We fear being ridiculed publicly.
So, Microsoft Japan decided the special session after the conference ended, and to my surprise, they invite many speakers to the session. Speakers include Doug Purdy and Steve Swartz.
Since I had already solved my problem before the special session (see below), I didn't have any question about Indigo. But it was actually my chance to talk a little with Steve Swartz and Doug Purdy more... Should I have asked something, even some silly questions like "How many times in a month do you shave your head?"... I couldn't...
POST-PDC: Let's make it straight. Remoting is not and will not be gone.
When I said (and I guess that was what Don meant to say too)
Remoting has no future, it is meant to be said that the architecture of its extension mechanism (ContextBoundObject and IContributeXXSink) has no future. Steve Swartz told us many new features of Indigo about extension mechanism and architectural changes.
Object remoting feature is still available in Indigo. It is just that sometimes it is inappropriate to implement distributed services in terms of objects. But I should say also that it is sometimes inappropriate to implement distributed services in the interoperable way, because interoperability does not come without costs. It is not what Microsoft has to decide but we developers and our customers are decision makers.
Therefore, Microsoft will give us many options in Indigo. Indigo is great in that it gives us not only selection, but also consistent programming model. What we choose does not affect how we program. And as I write this entry, I now remember that this has already been said by
Ingo Rammer days ago...
PDC: "XQuery is the Death-Star"
System.Xml and related namespaces is, I would say, completely changed. XmlDocument is dead. XPathDocument is the way (in the PDC bits we have XPathDocument2, they will change the name and make it just XPathDocument). XPathDocument is now writable using XPathEditor. The name, XPathEditor, implies that it uses XPath data model rather than DOM data model that is InfoSet. They even have XQueryProcessor. The speaker told us that "XQuery is the Death-Star. It all throws away other specs." What a fun (or mess?) begins...
PDC: ObjectSpaces reveals how difficult O-R mapping is.
We have heard ObjectSpaces two years ago. We even had some bits to check it out. Past two years, ObjectSpaces seemed not making great step forward.
We know that generic O-R mapping is very difficult. There are no succeeded project for the purpose. ObjectSpaces is really a wild challenge, and even smart developers at Microsoft could not make revolutionary step, even they have been hide behind for two years. I expected ObjectSpaces a lot, but now I should say that for my priority list for PDC bits to check out, ObjectSpaces is definitely at the bottom of the list.
PDC: Avalon is great
Yes many PDC 2003 alumni knows that Avalon is great. But wait. Avalon is great not only in that its GUI is fantastic and XAML should be useful for developers and designers working together, but also in that its administration related features.
Chris Anderson showed us a little in his talk on 29th. It seems we have urn:schemas-microsoft.com:asm:v2 namespace, and the namespace has installFrom and many security related elements declared.
Chris even said that we may not have executable files (.EXEs) anymore. Users should instead double-click an App.manifest file (for App.exe) to run the application. Manifest file consists of information for dependent assemblies and security, and even about entry point information like <entryPoint name="Main" assembly="mainasm, version=..." />. I know it is not correct but the idea is something like that.
By the way, I heard from my friend
Drew that Chris could speak Japanese (a little maybe, but who cares). Wouldn't it be great if we would have Chris Anderson at the
Developers Conference Tokyo, though I am so sure it would not happen...