[Seaside] Re: [Q] Question on Magma (or other Persistence Engine for Squeak/Seaside)

Göran Krampe goran at krampe.se
Fri Apr 13 14:31:13 UTC 2007


Hi!

> For me, the most difficult part is - and this is my major reason for
> previous mail;
>
> 1. how to perform "SELECT something FROM ... WHERE NAME=xxx" kind of
> operation in ODB.

How to handle such operations vary depending on ODB.

In Magma you have very nice support for two things needed:
  - Large Collection classes. A MagmaCollection is a multi purpose "super
large" (segmented) collection.
  - Proper indexing support for fast lookups in MagmaCollections. Magma is
quite flexible in this department.

So whenever you have many objects that you need to do "selects" from you
should hold those objects in a MagmaCollection instead of a regular Squeak
collection. And to get fast lookups you need to create indexes.

See details here: http://wiki.squeak.org/squeak/2639

> 2. if I save dictionary class to magma, and I changed or added/removed
> element from dictionary, the whole dictionary is saved/restored to/from
> db file? or just changed element?

You wrote "changed or added/removed". If you change the element object
*itself* then the Dictionary isn't modified at all. But if you modify the
Dictionary itself (add or remove elements) then - yes - the whole
dictionary will be "saved/restored".

So the conclusion again is that it is perfectly fine to use regular Squeak
collections like Dictionary etc, as long as they don't get "too large".

In Gjallar we use just a handful MagmaCollections for the objects that we
get a LOT of and need to do fast "selects" from.

regards, Göran




More information about the Squeak-dev mailing list