Giter VIP home page Giter VIP logo

xor-persist's People

Contributors

spkl avatar

Stargazers

 avatar  avatar

Watchers

 avatar

xor-persist's Issues

Schema is too permissive

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.

Support for Dictionaries

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.

Remove dependency to derive user classes from XorObject

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.

Support for non-"XorObject"-typed XorReference lists

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; }

Exceptions are missing and custom exceptions should be used

  1. In some cases, the exceptions thrown by the .NET framework are handed to the user or no exceptions are thrown, even if helpful Exceptions with useful information could be thrown.
  2. The use of custom exception classes for this library is generally preferred and should be implemented.

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.

Problem when loading properties/fields that are assigned on construction

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"; }

Support for non-IEnumerable XorProperty and XorReference lists

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:

  • System.Collections.ArrayList
  • System.Collections.ICollection (using an ArrayList)
  • System.Collections.IList (using ArrayList)
  • System.Collections.Generic.HashSet
  • System.Collections.Generic.List
  • System.Collections.Generic.SortedSet
  • System.Collections.Generic.ICollection (using a List)
  • System.Collections.Generic.IList (using a List)
  • System.Collections.Generic.ISet (using a HashSet)

Support for the following typed would be appreciated but is of a lower priority:

  • System.Collections.Queue
  • System.Collections.Stack
  • System.Collections.Generic.LinkedList
  • System.Collections.Generic.Queue
  • System.Collections.Generic.SortedList
  • System.Collections.Generic.Stack

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.