Re: RFC mailbox interface



Hi,

On 2001.11.18 20:22 Kenneth Haley wrote:
> Hi,
> 
> You're right that I forgot the void* for internal data, but that is also 
> where the _Message list would be.  No one should be accessing it 
> directly.  The copy in routine already supports reference copies, just 
> store the _Message* in the folders list.  Ref counting may be needed 
> though.  Changing the _Folder* though may not work, see other discussion.

On the contrary, I think people _should_ access the message list, and also 
the _Folder list of the message. Going though an API to do things that may 
need to be done in tight loops is inefficient. I'd much rather ahve such 
simple structures accessible directly. The API description should clearly 
state that such access is _read only_, if someone does modify the data, on 
his head be it!

So, read directly, alter through API seems to be the correct solution, also 
would solve some Balsa performance problems.

In my model, ref counting is implicit:

The _Folder has a messagelist, it's element count is the count of messages 
in the folder.
The _Message has a folder list, it's element count would be the ref count.

I don't think that it would be wise to mark a message as being a reference, 
I think that VFolder messages should be totally identical to real folder 
messages, except that the folder will not survive a restart of the 
application and will not persist on disk when closed.

Now, maybe you'd argue, what happens when a message is deleted from a 
VFolder? Well, it's deleted from thje VFolder. That's all there is to it! 
It lets me narrow down my search results manually, nothing more. It does 
not delete the original message!
To do that, I would have to right click and choose "Delete all instances", 
which would traverse the folder list, calling delete_message on each.
Assume I want to delete all messages _not_ matching a complex set of search 
criteria. I could then do successive searches until I have a VFolder that 
has all the messages I want to keep. Then I could delete the contents of 
the original folder and move the VFolder's contents to the original folder. 
Using true references, the original message would be deleted and the 
reference useless. That would also make it necessary to have callbacks for 
UI updates, and so on. No, that's too complicated for my tastes. In my 
design, the lib will do _exactly_ what it's supposed to do on _exactly_ the 
message or set of messages given - no side effects, no risks, no confusion. 
A VFolder is a folder, it can actually store messages, not just references!

Wow, that's $0.05 *g*

Melanie



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