Web tool kit : pro - cons ?
ianb at colorstudy.com
Wed Jul 30 17:16:53 CEST 2003
On Wed, 2003-07-30 at 01:28, Jeffrey P Shell wrote:
> Database Abstraction is another key issue. Zope gets points here not
> only for the built in ZODB database, but for SQL Methods / Database
> Adapters. There is nothing in Zope that is tied to Postgres, MySQL,
> Oracle, Sybase, SQLite, etc. Yet it's always been able to use any of
> them since before it was Zope. There's just a nice simple abstraction
> layer that one seldom has to think about.
Praising SQL Methods? Maybe I've been missing something, but SQL
Methods seem really primitive to me, certainly worse than the DB API
(though I suppose they preceded the DB API). The transaction stuff is
convenient -- if sometimes mysterious (like so many Zope things). But
it's not solving a terribly difficult problem.
> Other tools try the O-R
> mapping route for abstraction with varying degrees of success.
> SkunkWeb has PyDO, Webware has one (I can't remember its name right
> now). Zope's model is nice because it's not intrinsic to Zope that
> you use SQL - it's just a nice model to plug into if you need it, when
> you need it. I don't know how other toolkits stack up here. Some may
> just say "go find a Python adapter that works for you and do what you
> want with it", which seems to be as good of a way to go as any.
PyDO and MiddleKit (Webware's) are both independent of their frameworks
(it's kind of unfortunate that they appear to be tied, though), as are
the other ORMs (like my SQLObject). All three provide something
approximating business objects built around database rows.
My impression of Zope's SQL Methods is that they encourage distinctly
un-OO style of programming, and instead everything is done through a
heap of ad hoc queries and eclectic query results. At least, that's the
code I've encountered, and it's taken discipline to avoid doing the same
thing -- maybe there are better ways to use SQL Methods than what I've
been exposed to. (If so, it would be better if Good Zope Style was
documented, not just learned through wisdom born of failure -- but I
haven't found that sort of documentation for Zope yet).
More information about the Python-list