[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Gnue-dev] geasList.py: class name -> table name
From: |
Reinhard Mueller |
Subject: |
Re: [Gnue-dev] geasList.py: class name -> table name |
Date: |
11 May 2002 09:41:55 +0200 |
Jens,
Am Fre, 2002-05-10 um 01.22 schrieb Jens Müller:
> # TODO: get the table name from the class name
> self._datasource.buildObject (name = "",
> database = "gnue",
> table = self._classname)
>
> Am I right that classname is something with dots (like
> "base.currency.currency" or "finance.acct.param")?
We had somewhat decided to have the concept of not-nested modules (=
namespaces). In GEAS (v1), modules were separated from the class name by
a :: (which is actually horrible IMHO, because in C++ :: is used to
separate the class name from the member name).
I could imagine very well to use a dot to separate the module name from
the class name, or another special character.
I think we should in any case use the "::" to separate the class name
from the field/method name.
> To what shall it be converted? The same with underscores instead of
> dots?
In GEAS (v1) we used double underscores (__) so that single underscores
are still valid in all identifiers. I still think that was a good idea.
> Well, anyway, should there be a separate function to accomplish that?
>
> If so, where should it be? A separate module in /common/src?
>
> Even if the exact mapping is not clear yet, I would write that
> function.[1]
The plan would be to have a python module "geas.obrep" or something like
that (that expands to "object repository") which keeps track of all
defined objects.
This module would provide a means for looking up a class and getting the
table name for the class.
The same way, it would provide a means for looking up a field name of a
class and getting the field type, the database column name etc.
In any case, this object repository would at the same time check if the
class name / field name is defined in the business object definition at
all.
Any help is highly appreciated. Not only, but especially when it results
in good usable code :)
Thanks,
--
Reinhard Mueller
GNU Enterprise project
http://www.gnue.org