|
|
About
Christian Simms's Software R&D, Generative Programming and other R&D.
Subscribe
Subscribe to a syndicated feed of my weblog,
brought to you by the wonders of RSS.
Links
These are a few of my favorite links.
Oligopoly Watch
Google News
The Register
Slashdot
F***edCompany
Drudge Report
The Economist
|
|
|
Tue, 17 Aug 2004
Evaluation of 3 Python Tools to Develop Apps with Postgresql
No, these aren't just Object Relational mapping tools. After doing applications that use O-R for
several years now, I've decided that you can't completely hide the relational features from the
object interface, so don't try. I looked at the following tools:
- Roundup issue tracker
This is an issue tracker whose design is so good you can build an application on it.
It's basically a Python app server.
- Clever Features
- Really simple way to specify schema. Below creates 2 tables where second table has foreign key to first:
project = Class(db,"project", name=String(), creationDate=Date())
task = Class(db,"task", name=String(), project=Link("project"))
The above causes 2 main tables to be created, plus 2 shadow audit tables, plus integer primary keys.
Plus it creates indexes for the foreign keys.
- Works out of the box: just cd to its directory and run "python demo.py" and you have a fully functional
bug tracking system.
- Automatic schema upgrader -- when app server starts up, it compares current python model (as defined above)
with database's schema (stored in one row of special table schema which contains
a repr()'ed dictionary of information about each Class that maps to a table
- Mail integration - has a mail filter to receive bug reports through email. This filter also archives
email-based bug discussions, attaching the discussion to the appropriate bug. Wow this is a killer feature
for a bug-tracking system.
- Flaws
- Instead of db-level triggers, it has app-level triggers -- changes made through python are stored in audit
tables, but those directly through db are not.
- Inflexible naming - for class project, it creates tables: _project and project__journal.
- Hardcoded to use psycopg postgresql db driver (minor flaw).
- Modeling (Object-Relational Bridge for python)
This is a heavy-weight modelling tool, this is what a committee would design. Reminds me of
EMF (Eclipse Modelling Framework) which is just as heavyweight.
If you think the way to start app development is to write a big UML model, then this is for you!
- Clever Features
- Has a Zope product which lets you edit your model through Zope. This sounded cool to me, but when I tried
it out, it's basically a thin client data entry app -- sorry I don't need that, I like having my model defined
in a text file that I can version and use in text editors.
- Really flexible - let's you specify lots of details about each object and field, either in XML or python model.
Also supports run-time APIs or generated code APIs.
- Flaws
- Heavyweight and complex. For instance, instead of writing SQL queries, it has its own SQL-like (but not SQL!) language.
Twisted Enterprise ROW (R)elational (O)bject (W)rapper.
A really simple way to do twisted programming against an existing db schema (yes it doesn't create
the schema for you). It requires you to write a class for each table, and in this class write out
how to map db columns + their types to python attributes, including PK and FK relationships.
- Clever Features
- Maps to whatever your existing db schema is.
- Flaws
- Does not create schema for you.
[]
permanent link
|
|