Question about libcloud design

4 views
Skip to first unread message

DanInDC

unread,
Nov 10, 2009, 3:22:11 PM11/10/09
to libcloud
Hi All, I've been poking around libcloud and I'd like to use it in one
of my projects. Thing is I am new to Python and have no experience
with Zope. From what I can tell from looking at the code and the Zope
documentation, the Zope interface stuff is used just for book keeping?
To ensure the interface contract is kept.
If anybody could expand on this topic or the general design philosophy
behind libcloud it would be greatly appreciated.

Tom Davis

unread,
Nov 10, 2009, 3:48:22 PM11/10/09
to libc...@googlegroups.com
Hey there!

For our purposes, zope.interface is used largely for book keeping. Drivers are required to implement the various interfaces which makes it easier for writers and maintainers to identify mis-configured drivers. However, Interface has many other capabilities and is especially powerful with respect to registering adapters and so forth. You can read the comprehensive documentation on pypi:

DanInDC

unread,
Nov 10, 2009, 4:10:26 PM11/10/09
to libcloud
Thanks! I was looking at that documentation earlier, and I guess my
specific question is the *Factory stuff.

Suppose you remove the INodeFactory class and 'interface.classProvides
(INodeFactory)' in the base Node class. What changes?
I'm sorry if this is really obvious but the documentation doesn't make
it clear why we need this design idiom and its not clear to me from
reading the libcloud code.

On Nov 10, 3:48 pm, Tom Davis <t...@dislocatedday.com> wrote:
> Hey there!
>
> For our purposes, zope.interface is used largely for book keeping. Drivers
> are required to implement the various interfaces which makes it easier for
> writers and maintainers to identify mis-configured drivers. However,
> Interface has many other capabilities and is especially powerful with
> respect to registering adapters and so forth. You can read the comprehensive
> documentation on pypi:
>
> http://pypi.python.org/pypi/zope.interface/3.5.2
>

Tom Davis

unread,
Nov 11, 2009, 8:04:29 PM11/11/09
to libc...@googlegroups.com
Basically, the factories allow us to document what the __init__ method does in a proper way. For the rationalization for this and an example, see: http://pypi.python.org/pypi/zope.interface/3.5.2#declaring-provided-interfaces
Reply all
Reply to author
Forward
0 new messages