[Zope3-dev] defining interfaces

Garrett Smith garrett@mojave-corp.com
Sat, 5 Apr 2003 13:28:19 -0600


> -----Original Message-----
> From: Steve Alexander
> Sent: Saturday, April 05, 2003 6:47 AM

> However, if I want people to provide alternative=20
> implementations for the software in the 'Bar Toolkit',=20
> I'll want to provide the interfaces separately. There are
> a few ways to do this. I might add the interfaces to a=20
> general 'interfaces.py' module. But, that causes problems for=20
> installing and updating other projects in /home/stuff/foocorp.
> Instead, I might define the interfaces in=20
> /home/stuff/foocorp/interfaces/bartools.py.

It sounds like creating an "interfaces" subpackage that contains a
module for each interface is the most scalable way to manage interface
definitions. Why not just make this the recommended approach, given the
reasons you state?

I think it would be ideal to have a single recommended approach, even
for small projects. This would simplify people's development decisions
and help make projects more readable. Perhaps there could be an
exception for single file modules, but as these grow, developers will
have to restructure anyway, yes?

Btw, I'm not entirely clear on the term "project". For the sake of
external development (i.e. not core), isn't all development expressed in
terms of registerable products? Or do you expect developers to ship
frameworks that are not installed as products?

In any event, I started on a "best practices" doc for this topic, but
found the distinctions between the three alternatives to be a bit subtle
and not obviously useful. I'm curious as to what people think here.

Garrett Smith
Mojave Corporation