Hi Steven,
I've read link you provided.
They list limitations of the xml serializer but all they say about the
IDictionary interface is this:
A: The XmlSerializer cannot process classes implementing the IDictionary
interface. This was partly due to schedule constraints and partly due to the
fact that a hashtable does not have a counterpart in the XSD type system. The
only solution is to implement a custom hashtable that does not implement the
IDictionary interface.
When I started working with dotnet (1.0/1.1) I thought that IDictionary were
not supported due to schedule constraints.
Now I have to assume that this is a design decision.
As I understand it, the xml serialization saves the data without any
information about the implementation of the classes.
There is nothing to prevent you from serializating a List<int> and then
deserializing it into a int[], is there?
From a purely data oriented point of view a Dictionary is a collection of
pairs: key -> value.
The implementation details should not matter when you serialize it to xml,
so why can't you serialize it as List<KeyValuePair<TKEY,TVAL>>?
The fact that you don't have a counterpart in the XSD type for dictionary
might mean that you don't HAVE to support IDictionary in order to support
everything the XSD allows you to specify, But I don't think XSD knows about
the difference between an int[],List<int> or Collection<int>, does it?
It's very irritating to have to write wrappers for all objects that have
IDictionary properties.
Thanks,
Nadav