Re: Serialization review from August



I merged a bunch of stuff into my local master this weekend, but before I push I want to ask a bunch of things, since a lot of stuff I haven't merged until I understand its motivation.  SPOILER: at the end I suggest we create a XomSerializable interface that provides the API you desire, as distinct from the existing one (which aims to be small and restrictive like json-glib's). 

Unknown properties and types, errors and signals
In Serializable you create signals for unknown type and unknown properties, that seem to correspond with a couple of the errors in SerializationError.  Is the idea for them to replace or supplement those exceptions, allowing a programmer to improvise a solution?  Or, based on its usage in SerializableTest.vala, is it supposed to replace deserialize_property ()  (the user defines their own serialization functions and connects them instead of implementing named ones in the interface?)

Right now it seems a bit redundant with what {de,}serialize_property () provides. I can see that it might be useful if the types that a program uses might change and it doesn't want to have to try to recover simply from a GError (that is, the signal provides the GXmlNode node and GParamSpec spec to work with).

alternate names and values: serialized_xml_node_value, node_name, property_use_nick
property_use_nick: Why are you interested in using the nickname for the property?  I see it getting used in SerializableObjectModelTest.vala.  Is it only for SerializableObjectModel (SOM) serialization?
node_name: With node_name, is there any particular reason why you want to change the node name from Object?  In SerializableGeeTreeMapTest.vala, the node_name () overrides are just the name of the type but in lower case, and the original type name would appear in the otype attribute anyway (<Object otype="SpaceContainer">).
serialized_xml_node_value: is this just for SOM serialization?

interface: virtual vs abstract methods
You seem to prefer abstract methods with a second default implementation method over using virtual methods in the interface.  Is there any reason why?

init_properties:
Mostly seems to set up ignored_serializable_properties and unknown_serializable_property.  Can we just do that in the property's construct {} section instead, and eliminate this? I feel like other serialization and deserialization tasks for a Serializable object can be done in {de,}serialize_object

Naming
I mentioned in the previous e-mail that I'm hoping to keep naming consistent with the other serialization API used in GNOME, json-glib, for a consistent experience.  I'm inclined to thus keep things like {get,set}_property, find_property and list_properties the same names.

An idea
I feel like a lot of choices in your work come down to supporting the XML Object Model style of serialization.  Would you be OK if we created XomSerializable (or XOMSerializable) that embodied those?  That way, the existing Serializable work would continue to agree with json-glib's serialization approach, and would continue being minimal (things I've merged locally from your work include things like the properties blacklist, interface methods for object-level serialization instead of just property-serialization, and for serializing/transforming values by types).  The two can continue to share code and implementation (like in Serialization's serialize_object () and deserialize_object ()).

If we create the XomSerializable, I'll also be fine committing just about whatever you want to it (as long as it doesn't break the API of other stuff or strangely pollute the namespace :D).  How does that sound?  We could create a subdirectory in the source tree, like gxml/xomserialization/ or gxml/xom or something.   (I've been thinking of moving serialization into its own tree already, just because of the growth of serialization files :D)

Cheerio,
   Richard




On Sat, Nov 16, 2013 at 1:42 PM, Daniel Espinosa <esodan gmail com> wrote:

I agree you merge with modifications. At the end tests must pass, if not I could fix them but directly on master.

El nov 16, 2013 9:38 a.m., "Richard Schwarting" <richard schwarting ca> escribió:

I'm happy with a lot of it.

Would you prefer if I just give you feedback and let you respond to it, or
do you mind if I start merging things with modifications (API names, visibility, comments) and perhaps changing to a new branch, and then you can object or agree to things?
(I feel like that second option may be faster, and save you from doing extra work)?


On Sat, Nov 16, 2013 at 9:24 AM, Richard Schwarting <richard schwarting ca> wrote:
Doing so now.  Thanks.


On Sat, Nov 16, 2013 at 12:23 AM, Daniel Espinosa <esodan gmail com> wrote:

I'll answer your questions if you want but really prefer you review again because changes are a lot now, just make a quick check before.

El nov 15, 2013 8:59 a.m., "Richard Schwarting" <richard schwarting ca> escribió:

Hi Daniel.

Did you ever end up going over my comments from August 15th?
https://mail.gnome.org/archives/gxml-list/2013-August/msg00010.html

I know that on August 19th you responded (https://mail.gnome.org/archives/gxml-list/2013-August/msg00015.html) to my August 7th e-mail.

I asked on August 24th (https://mail.gnome.org/archives/gxml-list/2013-August/msg00020.html) whether you missed the e-mail from the 15th (above) but I haven't seen a reply yet.


If you don't want to go over the August 15th questions/concerns because they might not be out of date, I can do a new review this weekend.  If you can respond to even the August 15th review, then perhaps we can start merging this weekend.







[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]