Re: [gnome-db] Writing a ldap port



On 9/24/07, Exell Enrique. Franklin Jiménez <arawaco ieee org> wrote:
> Hello Vivien.
> Thanks..
> i've other questions..
> i'm looking on gda-bdb-provider.c, and to  create
> the GdaDataModelBdb
> calls the following function
> model = gda_data_model_bdb_new (bdb_file, bdb_db);
> that function is on
> gda-data-model-bdb.c
> GdaDataModelBdb inherit from GdaObject
> looking the struct from GdaDataModelBdb
> i see that it has a member called
> *priv, and its type GdaDataModelBdbPrivate.
> looking GdaDataModelBdbPrivatethat is a struct that
> defines some data types that i think that are
> typicalls from bdb model, my question is
> have i to create a similar structure to ldap?
>

Your GdaDataModel implementation wil have to implement a list of
columns (as GdaColumn objects) which will determine the data type of
each column of the data model. The Bdb data model is a bit special
since it has some virtual methods which allow one to subclass it to
actually "decode" the key and value parts of a BDB record (into one or
more columns each); this is a specifity of BDB which you don't need to
reprocude since it's you who define the data type of each column.

What you need to do is:
* decide what columns the data model will have (and create a list of
columns which will be used in the implementation of
gda_data_model_describe())
* decide how to map from one data model row to and from and LDAP
"row", how writing will be done (if possible), ...
* decide from which object to inherit: you can inherit from GdaObject
and implement the GdaDataModel interface "from scratch", or, if it
suits you better (depending on how you want to organize your data
internally), you can inherit GdaDataModelArray or GdaDaraModelHash.

The GdaDataModelArray internally is a big GArray of rows (the row
number is then used to retreive a row), the GdaDataModelHash
internally uses a GHashTable to retreive each row from a key (in both
cases a row is a GdaRow object).

Cheers,

Vivien



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