[Seaside] GOODS design question
Brian Murphy-Dye
brian.murphydye at mac.com
Thu Jun 17 00:04:46 CEST 2004
Avi, this helps a lot and sounds pretty exciting! GOODS handling all of
the referential integrity junk is definitely nice. Given your example,
I would first need to
(db root at: 'studentByName') put: Dictionary new
right? (Or perhaps 'BTree new'.)
I currently have a tangled web of 20,000 objects which I had tried to
store in a GOODS database a few nights ago and it crashed the db. Do I
need to add and commit a few objects at a time and slowly build up to
the full 20,000 objects? Or perhaps GOODS doesn't handle
SortedCollections?
Brian.
On Jun 16, 2004, at 3:28 PM, Avi Bryant wrote:
>
> On Jun 16, 2004, at 2:05 PM, Brian Murphy-Dye wrote:
>
>> I'd like to try using GOODS, but don't know how to design an object
>> database. For example, in a relational database used for school
>> course scheduling, there is basically a one-to-one mapping between
>> the classes implemented in Smalltalk and the tables in the
>> relationship database (with the addition of tables for the
>> many-to-many relationships). But if you do something like 'db root
>> at: 'Micky Mouse' put: aStudent' in GOODS, all of Micky's classes
>> will be stored as well (assuming there is a 'classes' instance
>> variable in the Student class), and then all of the students in those
>> classes. Is this acceptable or should I design my classes so they
>> don't contain other objects?
>
> That's totally acceptable. Indeed, that's the whole point: that you
> can use normal references between objects, and the usual collection
> classes, and so on, without having to worry about joins. One tradeoff
> is that you have to managed indexing yourself - a more realistic
> version of your example might be
>
> (db root at: 'studentsByName') at: 'Mickey Mouse' put: aStudent
>
> where you might also maintain studentsByStudentNumber, coursesByID,
> and so on. You'll generally need to use one of those indices to find
> the main object you're interested in, and then follow references to
> other objects from there.
>
> I should also point out the BTree package on SqueakMap - if you were
> going to have, for example, 5000 students indexed by name, you would
> be much better to use a BTree for the index than a normal, hashed
> Dictionary. It would be nice to see some other data structures (Trie
> comes to mind) if anyone has time... the performance characteristics
> of an OODB are (perhaps obviously) much closer to disk than to RAM, so
> all those data structures you learned about in school but rarely use
> are suddenly important again. ;)
>
> Avi
>
> _______________________________________________
> Seaside mailing list
> Seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/listinfo/seaside
>
More information about the Seaside
mailing list