[gnome-db] More *_new() functions with more than g_object_new()



gda_connection_new() seems to have the same problem - it does much more
than just call g_object_new(). It was probably the same in the old
libgda API, but now that GdaConnection has signals, it's a problem for
bindings.

Also:
- gda_connection_event_new() accesses a private member field.
- gda_data_model_array_new() calls an extra function.
- gda_data_model_hash_new() has this problem but I am fairly sure that
this is private API, maybe only for provider implementations. Maybe it's
already documented as that somewhere.

The objects under report/ also have these problems, but I don't know
whether they are meant to be part of the API.

On Tue, 2005-09-27 at 10:02 +0200, Vivien Malerba wrote:
> 2005/9/27, Murray Cumming <murrayc murrayc com>:
> > >> More importantly, gda_row_new() and gda_row_new_from_list should do
> > >> nothing more than call g_object_new(), because language bindings can not
> > >> all call the specific _new functions.
> > > 
> > > It's almost the case, but as the gda_row__new*() functions have
> > > parameters like the number of columns in the row or its values, there
> > > is a bit more code and that can't be avoided.
> >
> > This would normally be achieved with properties.
> >
> > If you absolutely can't do it (and I'm unlikely to find time) then an
> > extra gda_row_construct*(GdaRow*, theparameters) function (called from
> > gda_row_new*()) is an ugly workaround for now. We could then also call
> > that construct function after calling g_object_new(), instead of
> > copy/pasting all of the code (which we can't always do because it accesses
> > private API).
> 
> I'll add properties then:
> - "model" for the GdaDataModel (G_PARAM_READABLE|G_PARAM_WRITABLE)
> - "values" to set the initial values (G_PARAM_CONSTRUCT_ONLY)
> - "nb_values" to set the number of columns in the row (G_PARAM_CONSTRUCT_ONLY)





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