[Zope-PTK] Getting it all to work ;-)

Shane Hathaway shane@digicool.com
Sat, 01 Jul 2000 09:17:38 -0400


Jimmie Houchin wrote:
> This is a good time to think about these things. Zope is moving towards
> a cleanly and clearly defined Interface for it's programmers. The PTK
> should do likewise.

I have been pondering whether it might be beneficial to make use of the
DatabaseAPI product to solve the interface problem.  Not too many people
know about it because it was released about the same time as ZPatterns,
which got a lot of attention.  I wrote it with similar goals in mind.

DatabaseAPI lets you declare an interface specification separately from
the implementation.  It's probably mis-named; although it's useful for
connecting to databases, it can be used for a lot more.  It is made up
of two parts: DatabaseAPI, which you use to declare an interface, and
DatabaseConnector, which you use to implement that interface. 
DatabaseConnectors also provide certain kinds of separation that make
security controls simpler and more predictable.

DatabaseAPI does not make any assumptions about the structure of the
data, while ZPatterns assumes the data is stored in indexed database
tables.  Beyond that, it's difficult to compare DatabaseAPI and
ZPatterns.  However, if necessary, it should be possible to access a
DatabaseConnector through ZPatterns and vice-versa.

The real advantage DatabaseAPI has is that its function is very simple
as compared with ZPatterns.  ZPatterns tries to make it easy for end
users to connect arbitrary data sources and automatically wire together
the different data sources.  DatabaseAPI only tries to clarify an
interface.  As an experienced developer, if I can only choose one, I
prefer clarity over automation.

Please share your opinion.

Shane