[dev] Splitting the share driver

Dr. Gunnar Wrobel wrobel at pardus.de
Mon Aug 7 07:23:41 PDT 2006


Hi!

As I already mentioned on the kolab mailing list I would like to
extend the horde share system with support for different drivers.
Currently the share system is based on the datatree module and I'd
like to add another kolab driver that handles shares on basis of IMAP
folders.

My efforts so far look promising but I encountered one obstacle: The
identification of horde shares.

Each share has an id as well as a name. While creating a horde share
the id is commonly set to a random number - only if it is a default
share the owners id will be used instead. Subsequently most code that
creates new shares also sets the displayed name of the share.

This share name will usually be used to reference the share at a later
time. While there is a function "getShareById" that retrieves shares
by the id it is nearly never used throughout the horde modules (the
function getShares that also works with ids is actually never
referenced anywhere in the horde modules).

This type of structure is slightly confusing and also presents a
problem for implementing a kolab share driver. 

In my eyes it would be better to always refer to the actual id of the
share rather than referencing the displayed name (even though it may
also be unique). Is there any specific reason for having both id and
displayed name as unique identifiers of shares?

While I am able to cope for the current situation whithin the kolab
driver the code would be much cleaner if the id as the unique
identifier would always be used to reference shares. The name of the
shares would then only be fetched for display purposes. The reason
behind this is that the kolab shares are stored as IMAP folders and I
need to couple the id with the displayed name.

Thanks for any hints that enlighten me ;)

Cheers

Gunnar

-- 
____ http://www.pardus.de ___________________ http://gunnarwrobel.de

E-mail : wrobel at pardus.de                          Dr. Gunnar Wrobel
Tel.   : +49 40 432 72335                      Hartwig-Hesse Str. 12
Fax    : +49 40 432 70855                            D-20257 Hamburg
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  >> Mail at ease - Kolab out of the box <<                 P at rdus
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


More information about the dev mailing list