Re: [gnome-db] GdaValue sustitution for GValue



On 3/29/06, Daniel Espinosa <esodan gmail com> wrote:
> I propose to modify the GdaValue to use allways GValue for the next reasons:
>
>  1. GdaValue relays on GValue, must be clear to the developer that; and that
> the he/she can use g_value_* functions. Then Delete the GdaValue and use in
> all GDA's code just GValue. Please take note that Mono use GValue as the
> returning value from Gda.DataModel.GetValueAt.

I agree with this analysis.

>
>  2. Deprecate the use of GdaValueType for the API; it is usefull in the
> switch code of the providers, but for the API user, the developers, just
> want to know that he/she Gets a data of the type "this" that can use in, for
> example, any kind of Widget transparent.
>
>  3. Deprecate the gda_value_new_* functions, use the GValue creation API.

There is no g_value_new_*() function. I think it's worth keeping them.

>
>  4. Deprecate any function that already exist in the GValue API. Then any
> value like gint, guint, gint64, and so on, must use the g_value_get_*
> functions.

Yes.

>
>  5. Deprecate the use of "not GLib's standar names", like BIGINT (INT64),
> SINGLE (FLOAT), to ensure that the developer all ways know the type of data
> gets from the providers. Then, modify the new numeric types like SMALLINT,
> TINYINT, INTEGER, BIGINT with SHORT, INT8, INT and INT64 respectly.
>

Yes.

>  6. May other sugestion is Deprecate GdaDate and use GDate and his API.
>

Ok.

I'd also like that the money type be removed as it's not worth keeping it.

>  Please review the attached gda-vaue.h. If you agree I can change the
> gda-value.c and gda-value.h and send it; of couse this will break the
> providers code but I think is better for the future of the GDA's API live.
>

I don't mind breaking the API now, but I don't want to break it after
2.0 is out. So don't do any deprecations, just remove or change the
API.

About the gda-value.h file, here are my remarks:
-> I think keeping the GdaValueType enum is safe as it can be used in
switch statements, but then it obviously can't represent all the
GValue types around. So I think it's better then to remove it
completely and rewrite the code where a switch was used.
-> as a consequence, remove the gda_value_convert_gdatype_to_gtype(),
gda_value_convert_gtype_to_gdatype() and gda_value_get_type() as well
-> I agree with Murray that in libgda header files we should only have
defines which start with GDA_ and functions which start with gda_
-> remove everything related to GDA_VALUE_TYPE_OBJECT,
GDA_VALUE_TYPE_MONEY and GDA_VALUE_TYPE_TYPE.

If you have a gda-value.c file, I'd like to see it, in particular the
the gda_value_stringify(), gda_value_new_from_xml() and
gda_value_new_from_string() functions.

Then there will be a lot of work to re-write libgda to adapt to the
new GdaValue API.

Cheers,

Vivien



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