[Seaside] GOODS Updating a Collection inside of a Dictionary node.
bschroeder at procro.com
Tue May 18 15:14:26 CEST 2004
> I've got GOODS installed and am tinkering with it. I have a usage
> question. I've created a root as a Dictionary. With values as Ordered
> Collections. Each Ordered Collection corresponds to a table in an
> RDBMS, that I'm converting to Squeak.
> Each item in the Collection is an array representing a tuple or row from
> the table. My question is: how would I update an array item in the
> Ordered Collection. Is there a better way, than
> 1) retrieving the entire collection: db root at: 'foo'
> 2) changing on of the items. someCollection at: x put: y
> 3) writing the collection back to the dictionary. db root at: 'foo'
> put: someCollection
This is how I would do it, but step (3) shouldn't be necessary. You can say
someCollection := db root at: 'foo'.
someCollection at: x put: y.
and the commit should pick up the new contents of the collection.
Also, the GOODS client uses proxies that only load objects when needed, so
step (1) should not be too expensive: it would probably load the
collection's list of the objects that were in it, but not all of the objects
Hope this helps,
More information about the Seaside