This page is used to discuss the merging of esodan's Serialization work into GXml.
This has been a challenge, because my original intent has been to have an API that mimicks json-glib's Serialization framework. However this wasn't communicated well so esodan's XML Object Model-based serialization diverges quite a bit. Here I'll note differences and plans for it.
Some principles to guide choices * minimal work for user; want as much serialization automated as possible * minimal interface; interface can be extended in a subinterface * compatibility with json-glib * minimal unnecessary features in core Serialization
configure.ac: version changes
/ change version to 0.4 / add copyright for esodan * update dependencies (make sure those are shipped in distros) * change gxml.pc to gxml-0.4.pc (why? parallel installs?)
Attr.vala
x adds copy method (convenience method replacing 2 lines with 1? nah)
Serialization overview
* consider moving Serialization implementations into subdirs
Serializable.vala: the interface
* serialize: new: consider adding .serialize (), so you can handle serialization above the level of properties (why?)
- Options: 1: take the GXmlNode you'll be serialized into, and return true/false for automatic serialization to continue/stop 2: take nothing, return a GXmlNode created here (belongs to no Document?) 3: take a GXmlDocument, return a GXmlNode
* serialize_property:
- 1: removing property_name (redundant with spec), replacing GXmlDocument with a GXmlNode to serialize into, don't return a GXmlNode (caller passed it already) and instead return true/false (to continue automatic serialization) 2: keep the same
* default implementations:
- deserialize:
- 1: have it call a "default_deserialize", a protected virtual method (that can be overridden)
- have default_deserialize by default call a Serialization.default_deserialize_object
- 1: have it call a "default_deserialize", a protected virtual method (that can be overridden)
- find_property_sn, list_properties_sn, get_property_sn, set_property_sn
- 1: call overrideable Serializable.default_*_sn (); defaults still call corresponding GObjectClass/GObject methods
* find_property, list_properties, get_property, set_property: distinguish from GObject and GObjectClass names
- 1: add _sn (for serialization)
Serialization
* private "generic" functions, abstracting Serializable versus non-Serializable calls
- affects serialize_property (), serialize_object ()
* serialize_property:
- change 3rd parametre from GXmlDocument to GXmlNode, change the return type to true/false, append straight to parametre node
* serialize_object:
- adapt to changes from using generic functions, changes to Serializable's interface
* deserialize_property:
- simplify error handling (leave it up to string_to_gvalue?)
* clear_caches:
- renamed from clear_cache
* deserialize_object:
- adapt to use generics
* string_to_gvalue
- improve error message