Closed arteymix closed 8 years ago
After thoughts, this PR should be reoriented as follow:
GLib.Parameter
to store the request parameters (just the Value
on the stack though)to_url
to reverse a route from a sequence of parameters GLib.Parameter[]
string
to Value
and vice-versa) by defining functions based on GLib.Type
Also, it does not appear to be possible to store GLib.Parameter
in Value
, which makes it impossible to push them on the routing stack.
It's possible to register type transformation functions that would convert from our types to target types: http://valadoc.org/#!api=gobject-2.0/GLib.Value.register_transform_func
Types in parameters would just become GType identifiers and extraction/marshalling would just become type transformations.
Parameters will be stored in the context.
The request paramters can integrate better with GObject if they consist of a list of
GLib.Parameter
. At first, it will be possible to unpack them in an arbitrary object and access the parameters by properties.Then we could rework the current type system for parameters so that it can expand automatically the desired type.
We could also use
Variant
serialization to store and extract data: http://valadoc.org/#!api=glib-2.0/GLib.Variant