spkl / xor-persist Goto Github PK
View Code? Open in Web Editor NEWXorPersist is an easy to use XML serialization library for .NET
License: MIT License
XorPersist is an easy to use XML serialization library for .NET
License: MIT License
The XorPersist.xsd file is too permissive in "prop" and "ref" elements. The following snippet can be part of a valid schema instance:
<obj cn="RootClass">
<prop mn="String">this is a string <obj cn="A"></obj>bla bla bla</prop>
<ref mn="Reference">abc<null/>abc</ref>
</obj>
Free text/mixed content should not be allowed in "prop" and "ref" tags with element content.
Native support for dictionaries is missing. Currently, the key and value collections have to be marked as separate XorProperties, and the dictionary has to be initialized by utilizing the XorInitialize method.
Currently, all user implemented classes must be derived from the class XorObject. This is to give all classes the XorId/"_XorId" property, but it is possible to assign all objects IDs i another way:
A central ID manager class creates, assigns and reports the IDs of all objects during the loading and saving progress.
Properties with a type like Nullable/int? should be supported.
As of now, reference lists can only be typed in one of the following ways:
public IEnumerable<XorObject> References { get; set; }
public XorObject[] References { get; set; }
It should be possible to used stronger typed IEnumerables, as it is already possible with XorProperty lists:
public class Foo : XorObject { ... }
public interface IFoo { ... }
...
public IEnumerable<Foo> { get; set; }
public IEnumerable<IFoo> { get; set; }
Example for 1:
No exception is thrown if a reference cannot be resolved after the model was loaded.
Example for 2.
The parameterless constructor is missing at an XorObject type. A System.Exception is thrown instead of a (e.g.) LateNightStupidities.XorPersist.CtorMissingException.
If an object tree is loaded from a file, and the used classes assign values to properties/fields on construction, XorProperties and XorReferences that are "null" in the saved file, will not be null after loading. Instead, they will have the values, that are assigned on construction.
class Test { [XorProperty(nameof(TestField))] public string TestField = "WrongValue"; }
Currently, it is only possible to use a IEnumerable (XorReference list) or a IEnumerable (XorProperty list, where T : XorObject or interface) for lists.
Other collection classes should also be supported, so a private "translation" property is not necessary.
The following types should be supported:
Support for the following typed would be appreciated but is of a lower priority:
Classes without a public parameterless constructor should be supported.
Documentation should be created for all features.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.