[Seaside] Databases for the Testmaker website
Colin Putney
seaside@lists.squeakfoundation.org
Mon, 29 Jul 2002 17:53:57 -0700
On Monday, July 29, 2002, at 04:39 PM, Tim Rowledge wrote:
> (Colin, I added you explicitly since I don't know if you're on the
> seaside mailing list; if you are then let me know and I can save you
> getting two copies of everything)
Yup, I'm here.
> I have a feeling that it would be smart to use a very boring, standard
> system for all those reasons I outlined in a message to the squeak list.
> It's hard enough getting dunderheads to accept the idea of a webserver
> written in anything other than jarlthon without tryingto explain that
> the data is being kept in a wierdo format understood only by criminal
> minds involved with open source ruby-ridge activist terrorrists
> dedicated to the overthrow of civilisation.
Given this constraint, I'd say that Tantalus is a pretty good fit to
your problem. (For those that don't monitor the squeak-dev mailing list,
Tantalus is an object-relational mapping framework.)
This is the general scenario:
You'd use MySQL to store your data. (Tantalus uses ODBC, so you could
use another relational database if necessary, but we've only tested with
MySQL). Assuming decent hardware, the amount of data you're talking
about is reasonable - MySQL will handle it nicely.
You'd design classes to represent all the entities you described -
Customer, Teacher, Student, Test etc.
You'd create a database to store your data. Typically that would be a
table for each class, with a field for each instance variable. There
would also be fields to describe the relations - which teachers belong
to which customer, for example.
Your Seaside app would use Tantalus to store and retrieve data. Tantalus
would handle all the business of marshaling instances of your entity
classes to SQL and reconstituting them from raw database records.
I'm using this pattern for a project of my own. There are a few things
you need to be careful of here and there - calling self changed in your
entity classes for example - but basically all the gork associated with
the database is encapsulated in one or two places.
I guess if I'm going to talk it up this way, I better get Tantalus
released. Stay tuned.
Cheers,
Colin
Colin Putney
Whistler.com