[TransWarp] peak.naming .. first contact

Ulrich Eck ueck at net-labs.de
Fri Feb 14 13:22:58 EST 2003

--On Freitag, 14. Februar 2003 12:42 -0500 "Phillip J. Eby" <pje at telecommunity.com> wrote:

>> I also thought about building datamanagers for imap-access, but i have no
>> idea how to setup tree-like dm-structures. Setting up datamangers would
>> have the advantage of being able to cache results and more ..
> It's certainly possible to do that, but the implementation structure would probably be very different than what I've
> outlined.  Instead of passing down a connection between contexts, you'd probably need to pass down the data manager.
>> or (if more appropriate) how to build dm's for tree-like content?
>> (i could imagine using a tuple(<folder>,[None|messageid]) as key for the dm.)
> You could do it that way, if by '<folder>' you mean a folder path string.


> I'd say that the optimal way to do this depends a lot on your application and how it wants to use IMAP.  If you need
> to acess IMAP in a "navigational" way, naming contexts might be better.  If you need to address specific objects or
> transform representation, data managers are more suited.  If you need a mixture of both, you can combine the two,
> either as a data manager that returns naming contexts, or as a set of naming contexts that use a data manager "behind
> the scenes".

for now i want to be able to lookup and create Folders mainly. one issue is, that i need to modify them e.g. by
setting the folder-acls. so when using the name-context approach, how do i access/modify attributes of the
context .. is there any preferred way to setup something like this ?? (i remember barely that jndi has
methods for accessing attributes on contexts)

i've gone ahead with the data-manager approach and it looks good. (still need to figure out what's the best
setup for them, and how to build QueryDMs that are used by elements for e.g. 
i've seen the QueryLink Class in Datamangers. how could it be used to setup an ElementClass with
a feature that exposes the results of that query when called ??

class ImapFolder(model.Element):

    class folderpath(model.Field):
        """The Folders Path."""

    class folders(model.Collection):
        """Collection of ChildFolders."""

    class messages(model.Collection):
        """Collection of Messages contained in this Folder."""

would i just pass a state that has e.g.
return dict(Items(folders=QueryLink(MyFolderQuery[(<folderpath>,)]), ..same-for-messages..))
that is a not yet executed PersistentQuery and supplies a list-like interface
for the collection class ??

I think i want to explore both ways, mostly to learn and see the advantages of the different approaches.

thanks for your help.

Ulrich Eck
net-labs Systemhaus GmbH
Ebersberger Str. 46
85570 Markt Schwaben
fon:   +49-8121-4747-11
fax:   +49-8121-4747-77
email: ueck at net-labs.de

More information about the PEAK mailing list