-
Notifications
You must be signed in to change notification settings - Fork 0
Data storage
I-Al-Istannen edited this page Jun 29, 2018
·
1 revision
Outline:
- So we always store the type when serializing under a separate key (
==_$!!object_class
) - Each class that can be serialized can (must?) implement an interface that offers custom (de)serialize methods to a
Chunk
(the types are written when serializing) and a method to set the version. - You can register migrators that convert from one version to another and will be chained by the system as needed.
- When deserializing the object is constructed based on the types and if the version mismatches, all fields will be deserialized and the migrator is invoked.
- Serialization is not done against ConfigurationSection but against a Map-like datastructure (
Chunk
) that allows accessing nested keys easily via a dot in the path. - You can register Proxies that serialize from/to a Chunk. These are used to serialize types you have no control over as well as provide an internal mechanism to store maps/collections.
- Backends are tied to a file from which they load and save from
- Managers get data from backends(new name needed?) via a key (new interface needed for this!). A single file backend that just loads an entire file in memory and treats it as a Map and a multi-file backend that takes a folder and treats each key as a relative path is provided.
Problems:
- Backend has two meanings:
- JSON/YAML/WHATEVER storage
- Key-Value store that is queries by the Managers
- Anything else?