[Development] Proposal for an efficient and robust (de)serialization mechanism working with Qt-supported data
arnaud.clere at minmaxmedical.com
Tue Sep 3 16:42:48 CEST 2019
From: Jason H <jhihn at gmx.com>
> > My only remaining comment is QBind is rather ambiguous.
> > We already have "bind" used as for SQL parameters. Bind is also used for IP ports, Boost uses "bind" for connections. "Data binding" is another thing as well usually to bind data to UI elements.
> > Could it be called something else?
> I realized that I broke my own rule of criticizing something without suggesting a replacement.
> I don't have anything that jumps out, but in python, the struct module has pack() which us just as long and not used (to my knowledge)
> pack, wad (another indirect Doom reference), bale, herd, doss,
> transfigure (probably too long)
I cannot resist to suggest QTransmogrifier 😊 
Seriously, QBind is akin to GUI data binding and SQL parameter binding but more specialized so I would just pick a more descriptive name. Also, since it is a generic function class (not a functor), I would keep the verb Bind in it. And since it addresses only values (object graphs must be somehow encoded before they can be 'bound'), I suggest:
- QValueBind (= QBind, the generic function class with bind(QValue&& v, T t) overloads)
- using QValue = Val<Cursor> as the start point of the fluent interface allowing to describe any T 'value' in a generic way
I am also not comfortable with 'Cursor' (a non-owning unique pointer used to bypass illegal or useless calls to the fluent interface) which conflicts with the usual definition of SQL cursors.
More information about the Development