On Sat, 28 Jun 2003 12:24:02 +0200 (CEST) Robert Vazan <[EMAIL PROTECTED]> wrote:

> I looked at renaming code and IMHO it isn't the right thing and it will
> never be.

I agree.

> Now the question is how to fit identifiers into Mahogany. 

Yes.

> Using generated numbers looks ugly in configuration file.

We could use path+name+id as an identifier, with path and name as to
where the folder is created, and what the user gives as a name.

Do you look into the registry/configuration file for filters so often
that this would be a problem?

> More specifically, when fodler is moved, instead of physically moving
> all properties, it gets MovedTo=<new location> property.

I have two arguments against this proposal:

1. It is much more complicated than simply generating an indentifier as
   I proposed above. And this only gives us a very slight (IMHO)
   benefit, which is not itself always here, as I will show below.

2. Profiles implement a hierarchy, as the value for a particular entry
   is looked-up in the profile's parent if not found in the profile
   itself.

   Using 'MovedTo=<location>', we write down in the configuration file the
   history of changes, instead of the actual state. This means that we
   may have to parse several 'MovedTo=<location>' entries before finding
   the actual position of the folder. And this parsing would be needed
   for any access to any property of a profile, unless the profile class
   itself is only a proxy that gets pointed to the correct location.

It would be much simpler to provide a function

  Profile* GetProfileFromId(String Id);

that would be used by code modules that need to refer indirectly to
folders (the only one currently is the filter stuff, unless I missed
something).

> To make enumerating subfolders easy, the [<new location>] folder is
> actually created, but it has only MovedFrom=<identifier> property.
> With careful coding, cyclic renaming and special cases can be handled. 

Suppose I execute the following sequence (shown with the Profile
informations):

- Create folder A

    [folderA]

- Rename A to B

    [folderA]
    MovedTo=B

    [folderB]

- Create another folder A

    ??? [folderA] already exists

You would need to add some kind of special tag when creating folder A
for the second time. So you can't really use only the name as
indentifier for a folder. So the benefit of using only the name of the
folder is not always present.

> I don't yet understand how exactly are folder properties looked up but
> it seems to me that adding MovedFrom/MovedTo handler as a layer under
> ProfileImpl::readEntry would do most of the work.

But this would be much more complicated than simply providing a lookup
from Id to Profile, and continue to use the profiles as they are now.

-- 
Xavier Nodet
"They that can give up essential liberty to obtain a little temporary
safety deserve neither liberty nor safety." - Benjamin Franklin, 1759.


Attachment: pgp00000.pgp
Description: PGP signature

Reply via email to