I’m in the process of designing a workflow framework (in Python, of course). As I’m laying it out, it’s helpful to think in terms of the types of the pieces that are going to interact with one another and what they can do. I’ve begun creating “base” classes which define empty methods which I plan on objects of corresponding “concrete” classes containing. This is all a nice thought experiment as it helps congeal some of my thoughts, but there is effectively no real value in implementing these empty base classes.
Some time back, I had read about Zope interfaces. I didn’t really think much about them at the time, but now I’m giving thought to using them. Since the Python language does not provide linguistic constructs to specify an interface (at least, not like some languages do), I thought it might be helpful (if for no other reason than documentation and design) to use something like Zope interfaces to help build my workflow manager.
The alternative is to proceed as I had begun and lay out some empty “base” classes which will contain the methods which I expect “concrete” classes to contain. And rely on unit tests to enforce that instances of each concrete class will have the appropriate methods behaving in the appropriate way. (And I would assert that using unit tests is the right way to go even if you use “proper” interfaces.)
Now that I’ve layed out my situation, I have a question. Is there really any value to something like Zope interfaces? And if there really is benefit, is it merely documentational and design-oriented which could be achieved with convention without having to rely on a tool such as Zope interfaces? Please post your comments here, as I’m really interested in reading what others thing on the subject.