[OpenSER-Devel] Re: [OpenSER-Users] Renaming the DB modules

Daniel-Constantin Mierla daniel at voice-system.ro
Thu Oct 4 13:01:19 CEST 2007



On 10/04/07 13:36, Henning Westerholt wrote:
> On Thursday 04 October 2007, Bogdan-Andrei Iancu wrote:
>   
>> Hi,
>>
>> during the reviewing process of the new DB module for Berkeley, I made
>> proposal to make a naming convention for all the modules implementing
>> the DB API.
>>
>> I suggest something similar as for the modules implementing the MI
>> interface, all having the "mi_" prefix. So, for the DB modules we should
>> use "db_" prefix:
>>     db_berkeley
>>     mysql -> db_mysql
>>     postgres -> db_postgres
>>     dbtext -> db_text
>>     unixodbc -> db_unixodbc
>>     flatstore -> db_flatstore
>>
>>
>> Does anybody see any drawback or problem if we rename the module before
>> 1.3?
>>     
>
> This change is resonable for me _if_ it will be thoroughly carried out. That 
> means in addition to the renaming of the directories its also necessary to
>
> - update the existing module documentation (README files, devel index.html)
> - fix the build process and the packaging
> - update openser install documentation (INSTALL, wiki pages)
> - add a note to the porting guide for 1.3
>   
as personal preference, I would add here the option of still being able 
to use database name in db_url parameters -- looks more natural in 
config file

modparam("avpops", "db_url", "mysql://openser:openserrw@localhost/openser")

than

modparam("avpops", "db_url", 
"db_mysql://openser:openserrw@localhost/openser")

Should be easy to attempt to try to find the module "mysql" or "db_mysql"

Since we got in such topics, perhaps we should go further and define a 
naming policy for:
- module name
- main file of the module
- exported functions by modules

For the first one, should be representative for the functionality 
brought, and in particular cases (db driver, mi transport, radius 
extensions, ...) should follow a clear pattern. If going for the above 
proposed system, first should be the category (same happens now with 
mi/presence/pua modules), so seems to be the appropriate one. In this 
way is very easy to spot the group of modules related to a category. 
Also, the name of the directory should be same as module name.

For the second, there are two main patters
- main file name matches the name of the module
- main file name is suffixed by "_mod"
Several modules do not follow any of above.

For the third, I propose that functions will pe prefixed by several 
letters derivate from module name, maybe abbreviation, or full name if 
it is short.

I think these will bring more coherence and consistency in the code and 
config file. Also, will easy automatic tools for checking exported 
structures, or generating goodies docs out of C code.

If the time for this release is not enough, we can leave it as it is, 
but should be taken in consideration for new contributions.

Cheers,
Daniel

> Cheers,
>
> Henning
>
> _______________________________________________
> Devel mailing list
> Devel at openser.org
> http://openser.org/cgi-bin/mailman/listinfo/devel
>
>   




More information about the Users mailing list