[Zope-dev] Re: The remaining spanner in the works :-)

Shane Hathaway shane@zope.com
Tue, 6 Aug 2002 22:55:28 -0400 (EDT)


On Wed, 7 Aug 2002, Anthony Baxter wrote:

> >>> Shane Hathaway wrote
> > I created another set of components called "record storages".  Their job
> > is to load and store record sequences in a schema that matches that of a
> > serializer.  In the current AdaptableStorage code, most of them are
> > still called a "table", the old name for "record storage", but when I
> > started serializing to the filesystem I realized that "table" wasn't
> > general enough!
>
> Plug: people might want to browse the online draft of Martin Fowler's
> "Patterns of Enterprise Application Architecture" for some nice ideas
> in this sort of framework. There's a whole section on Object / Relational
> Mapping Patterns. And unlike the GoF book, most of the patterns aren't
> just workarounds for C++ deficiencies </cheapshot>
>
> http://martinfowler.com/isa/index.html

I've read this.  It helped me get started.

> > Most record storages store data in some kind of database, but other
> > record storages act as a proxy for other record storages, converting
> > data in one schema to another.  This theoretically enables application
> > developers and database administrators to work independently, bringing
> > their work together through proxy record storages.
>
> Although this does mean you could end up in a really nasty nasty mess
> when trying to figure out responsibilities for the data changes - particularly
> if you're adding a new bit of data that needs to flow through the system from
> RDBMS to ZODB.

Most of the time there's an easy solution.  See the other messages in this
thread.

> > Record storages are similar to SQLMethods, with the difference that
> > record storages provide a way to both read and write a set of records.
>
> I think this sounds like a Data Mapper or a Table Data Gateway in the
> Fowler book.

I don't think any of Fowler's patterns correspond directly with a record
storage.  Data Mapper is the whole OR mapping, including all components.
Table Data Gateway is too specific in the wrong direction.  "Gateway" is
the closest, but it's too general.  And a record storage doesn't
necessarily store data in a relational database.  OTOH I could be wrong.
:-)

Shane