I’ve been following the thread about auto serialisation
I read with interest @gregsn post extolling the virtues of manual serialisation. I think it all makes sense but I have implemented this and created a huge web of XElement nodes, quite clunky to patch and a lot of work to keep updated. (Unless I’m just doing it in a stupid way… very possible).
My feature request is for functionality that would allow a hybrid approach, semi-automated serialisation.
-The functionality would be special SetByName and GetByName member operations that could be called for any object.
-They sift for the name of a pad in a given object and either Set or Get the value with a success bang. A special alternative to using pins.
-If the pad doesn’t exist they don’t succeed.
- This would allow me to build a much neater serialisation patch that takes a spread of x paths, a spread of pad names, a spread of values and an object and gives you a set object
-If versions have changed you can use the success pin to see what has failed and act accordingly.
It might look like this?
-I think a ‘ListPadNames’ operation might also be handy.
-End user can of course write more complicated versioning if they want. Eg with a diff.xml type setup that remembers old names.
-The failure conditions could distinguish between failing due to impossible parse or failing due to not finding a matching pad name
-You could expose internal parts of this to allow optimisation. Eg sifting for pad names creates an ‘object memory map’ and that whats applied to some raw form of the object to update the value. You could optimise by doing the sifting only once when you first run the program and then using the memory map after that.