Hi!
People tend to recommend to cache XmlSerializer instances. Is this still actual? (if no, when has it become so?).
Also I came up with the following code and ask to review it.
- Does it have any drawbacks?
- Will it use many threads\cores for different types?
- How can I improve it?
The code:
public static class SerializerFactory<T>
{
public static readonly XmlSerializer Serializer = new XmlSerializer(typeof(T));
}
and usage:
var obj = (T)XmlSerializerFactory<T>.Serializer.Deserialize(input);