[Zope3-dev] interface insight

Tim Hicks tim@sitefusion.co.uk
Fri, 11 Jul 2003 01:01:39 +0100 (BST)


Hi,

I've been lurking here for a while and this is my first outing on zope3-dev.

I'm just starting to play around with zope3's interface package and I have a couple
of questions that I hope you guys can help me with.

1) I'm playing with some classes to access IMAP servers and manage emails. 
Currently, I have defined two sets of interfaces along the lines of: ImyImapClass
and ICachingMyImapClass.
The two interfaces are essentially the same (although the caching ones have a couple
of methods like 'flush_cache' and so on), except for the fact that nearly all of the
methods in ICaching* take an extra optional argument 'force' which forces the method
to ignore the cache and fetch data straight from the server.

So, to my question.  Should I define the non-caching interface methods with the
optional force=0 argument so that the caching interface can just inherit all the
methods (of which there are quite a lot) - explaining that the force argument is
redundant for non-caching instances in the doc-string?  Or should I basically write
out everything twice, but with the force argument in the caching definition?

I guess this is just a style thing as both will work, but hey, there's no harm in
asking :-).


2) Is it possible/easy to compile interface/_zope_interface_ospec.c without
installing the whole of zope3?  I'm guessing 'yes', but I just get scared when I see
C and a compiler ;-).


Enough for now.

cheers,

tim