[Seaside] [Q] Tag-Note relationship, any suggestion?

Dale Henrichs dale.henrichs at gemstone.com
Thu Apr 10 15:56:16 UTC 2008


S.J.Chun wrote:

>Hi, 
>
>my web application uses following classes; 
>
>NOTE: which has "contents" and "tags" 
>TAG: which has "name" 
>
>What I want is getting notes using tag and simple but crude idea could be 
>using dictionary and set; 
>
>MainDBDictionary(an instance of dictionary). 
>
>inserting: 
>MainDBDictionary at: #SomeTagName put: (aSetOfNotesUnderThisTag add: aNewNote) 
>
>fetching: 
>MainDBDictionary at: #SomeTagName 
>
>current implentation does not above model; in fact I'm using SQLite but I want to remove 
>dependency on SQLite or other RDB. 
>
>Can above model be directly mapped into OODB? For example Magma? 
>If not, any suggestion on better design or reference/documentation on this? 
>
>Thank you in advance. 
>  
>
Speaking for GemStone (anOODB), the answer is yes. If MainDBDictionary 
is stored in a class variable or other global, then every object put 
into the dictionary is persisted. The mental model for GemStone is that 
_any_ object that would be preserved by an image save (and not subject 
to garbage collection) in Squeak will be persisted in the GemStone db at 
commit time.

Dale


More information about the seaside mailing list