robert burrell donkin wrote: > > > On 1/11/07, Joachim Draeger <[EMAIL PROTECTED]> wrote: > > Am Mittwoch, den 10.01.2007, 20:50 +0000 schrieb robert > burrell donkin: > > <snip> > > > > > Think of a mbox and pop3. The backend opens the file > and indexes it. > > > > > > that is not conversational state but an optimization > > > > Right, but without a session there is no possibility for that > > optimization. > > there are different ways which this could be implemented. the current > session concept is not necessary and in some cases can be detrimental. > > a flaw with the current API is that a session is opened before the > factory has any idea about what's it's to be asked to do. it is > therefore inefficient to perform any optimization when the session is > opened. > > for example, whenever an IMAP session is opened the session > pre-emptively caches the UIDs. at this time, the session cannot know > whether a particular command will need this information or not.
Aren't these 'flaws' the kind of things optimisations better handled in subsequent iterations once we (well just Joachim at the moment) have a working implementation of a MailboxManager API designed to satisfy our immediate requirements? I would like to see a functional implementation emerge in a timely manner that supports known consumers such as SMTP, POP3 and IMAP. We can move on to support for yet to be designed future protocols later. Concerning the caches, the pattern I tend to use is to pre-emptively do nothing and lazily initialise everything (this is very evident in the fetchmail code). This way resources are consumed only when they are needed. For cases where immediate initialisation is beneficial, all one needs to do is touch the used object during the initialisation stage of the using object to initialise it immediately. This strategy is useful when the using object has constrained response time objectives and the initialisation time causes them to be exceeded. Most times lazily initialising on demand is very performant and accomodating of a variety of usage patterns. <snipped/> Cheers, -- Steve --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]