Hi Christoph!
Thanks for your response!
I do need to use XmlSerialization. I'll try to explain why.
I have a bunch of assembiles reflcted at runtime and its information stored in a table for late execution (using Invoke). Every parameter and every method result is XmlSerialized and stored because these assemblies can commuicate with each other. So, when I reflect the Matrix.Inverse() method, its return type (Mathnet...Matrix) is stored so that others assemblies can use it, deserializng its value to a dynamic type, like this:
Sorry for this short (or crazy) explanation. The architecture complexity doesn't allow to write the hole logic.
Congratulations for this great library and once more, thanks for your help!
Kylderi
Thanks for your response!
I do need to use XmlSerialization. I'll try to explain why.
I have a bunch of assembiles reflcted at runtime and its information stored in a table for late execution (using Invoke). Every parameter and every method result is XmlSerialized and stored because these assemblies can commuicate with each other. So, when I reflect the Matrix.Inverse() method, its return type (Mathnet...Matrix) is stored so that others assemblies can use it, deserializng its value to a dynamic type, like this:
// Conversions.dll
// Create a Matrix from an Excel file
// Method signature: Public Matrix XlsToMatrix(byte[] buffer)
// Metadata table (AssemblyMeta):
// MethodName = "XlsToMatrix"
// ReturnType = "MathNet...Matrix"
// ParameterType = "System.Byte[]"
// ParameterValue = [XML Column]
// ReturnValue = [XML Column]
//------------------------------------------------------
AssemblyMeta meta = //[Read from database]
// type information is stored in the database
Type type = Type.GetType(meta.ParameterType);
// deserialize based on the type metadata
dynamic parameter = deserializeFromXML(meta.ParameterValue, type);
// reflect Conversion.dll and get its MethodInfo
// this creates a Matrix from my Xls
dynamic result= methodInfo1.Invoke(null, new object[] { parameter });
// store the Matrix
meta.ReturnValue = serializeToXML(result, meta.ReturnType);
This complicated engine (its only a part of it) was designed to have NO knowledge of the types and completely relies on the metadata stored. Due to this architecture I cannot use different serialization methods for different types, because it would result in a type aware routine (switch(type) case 1: case 2: etc). Also it would cause a problem if I tried to check a type that doesn't exist in the 'logic machine', since my logic and execution runs in separate computers. Sorry for this short (or crazy) explanation. The architecture complexity doesn't allow to write the hole logic.
Congratulations for this great library and once more, thanks for your help!
Kylderi