Register to post in forums, or Log in to your existing account
 

Post new topic  Reply to topic     Home » Forums » Zugg's Blog
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Fri Oct 01, 2004 4:53 am   

I'm past the hump!!
 
Finally!! I think I'm past my brain-lock and trouble that I was having with eMobius. Over the past couple of days I have taken it all apart, redone the interfaces, documented them in the Design section of the Knowledge Base, and the reimplemented based upon the new design.

The first *really* nice part is that I haven't had *ANY* memory or COM problems. The way all of the objects clean themselves up now has really helped with this. And I did a *lot* of rewriting of various COM objects and have several objects with circular references. No problem with any of them. Also, sharing data with the background threads and doing the background synchronizations also worked fine.

It's really nice for a change to be able to work on stuff that matters, like the design, rather than doing low-level stuff. It was actually FUN for a change!

The design has gone back and forth several times. If you look at the edit counts on some of the design articles, you'll see this.

First, the whole idea I posted before that IMAP UIDs are only unique within a "mailbox" really messed up the old design. So, I thought I needed to distinguish "mailboxes" from my "virtual folder" ideas (which can mix messages from different mail stores). After implementing two different interfaces, I ultimately discovered that the interfaces weren't that different and could be combined.

Next, I tried to simplify and break up the big MessageStore interface. For example, the POP Message Store doesn't need to implement mailboxes. So I split all of the stuff dealing with folders and mailboxes into an IzFolderStore interface. Also, I realized that there was a more fundamental interface for generic "storage" objects, so I created the IzStore interface. I implemented a IzStore object that works like an associative array in Perl, and also an IniStore object that uses the IzStore interface, but reads/writes data from either INI files or the System Registry.

So, the actual message store objects, like IMAPMessageStore implement multiple interfaces: IzStore, IzMessageStore, and IzFolderStore in this case. The POPMessageStore implements just the IzStore and IzMessageStore interfaces.

I ran into a slight difficulty with all of this, however. When you create an object in VBScript, you can ONLY access the DEFAULT interface of a COM object. I think I've mentioned this before. In regular VB, you can use the "as" keyword to refer to an object by a different interface. But not in VBScript. So, I had to kludge this a bit.

The way I handle multiple interfaces for the scripting system is to define a "big" interface that includes all of the properties and methods of all of the individual interfaces. I then make this the default interface for the scripting object. This allows me to use the small individual interfaces in my Delphi design, but then makes all of the interfaces available to the COM object in VB Script. It just takes a bunch of copy/paste in the type library editor in Delphi, so it's not too bad.

I've now got both my POP and IMAP test programs working now. And the IMAP program properly handles the multiple folders. Each program only fetches mail messages from the server as needed. The next step is to tie this together with file Caches using the Cache property of the Message Store so that it doesn't have to read a message that is found already in the cache.
Reply with quote
Rainchild
Wizard


Joined: 10 Oct 2000
Posts: 1551
Location: Australia

PostPosted: Sun Oct 03, 2004 10:41 pm   
 
Sounds like it's all starting to come together, that's great :)

Its kinda weird having this blog instead of everything in the forums, I keep thinking 'hrm haven't heard from zugg in a week or so' then go 'oh yeah, he has a blog now :)
Reply with quote
slicertool
Magician


Joined: 09 Oct 2003
Posts: 459
Location: USA

PostPosted: Mon Oct 04, 2004 1:14 pm   
 
I think Yoda said it best: "You must unlearn what you have learned..."
_________________
Ichthus on SWmud: http://www.swmud.org/
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » Zugg's Blog All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
© 2009 Zugg Software. Hosted on Wolfpaw.net