[Seaside] Persistent object framework

Jason Dufair jase at dufair.org
Thu May 13 16:26:41 CEST 2004


Avi Bryant <avi at beta4.com> writes:

> The thing that comes to mind, with an OODB, is indexing.  This is
> something that RDBs do for you, but that you need to handle on your
> own in an object setting.  The BTree class I put on SqueakMap is a
> good building block, but I'd like to build out something a little more
> sophisticated, that would manage several indices at once and could be
> told to update them all at once for a given object.  I'm thinking of
> an interface something like this:
>
> mgr := IndexManager new.
> mgr indexSelector: #name of: Person.
> mgr indexSelector: #startDate of: Project.
> .....
>
> person := Person new name: 'Avi'.
> mgr update: person.
> project := Project startingToday.
> mgr update: project.
>
> people := mgr findAll: Person where: #name is: 'John'.
>
> person name: 'Avram'.
> mgr update: person.
> ...
>
> Make sense?

This does make sense.  But it seems a bit cumbersome.  Perhaps we could
have a mechanism via the #addDependent: / #changed: mechanism that could
watch for changes and handle the index updating without the developer
explicitly having to manage it.

Even better, if we could somehow have a way to replace 

people := mgr findAll: Person where: #name is: 'John'.

with something like

people := Person store select: [:each | each name = 'John']

and just have it "do the right thing", index-wise.  What do you think?
-- 
Jason Dufair - jase at dufair.org
http://www.dufair.org/
"My grandfather once told me that there were two kinds of people:
those who do the work and those who take the credit.
He told me to try to be in the first group;
there was much less competition."
-- Indira Gandhi



More information about the Seaside mailing list