[Glass] how to update models properly

Sebastian Heidbrink via Glass glass at lists.gemtalksystems.com
Wed Oct 29 09:23:54 PDT 2014


Hi all,

I spent quite some time to get used to Gemstone now . Somehow I stumble 
across some questions and insecurities again and again.

I wonder if somebody can give me some hints on this.

I use Gemstone/Web without Seaside but with a ZincREST interface. Some 
of my data model objects a transfered via JSON or CSV betwenn db and 
client. Everytime the client wants to modify data on the server he sends 
a JSON representation of the object to the server and the server parses 
the json and creates a data model object from it.
Now I do have a persited version of my model object and the just newly 
created model object within the DB.
How would I update now? I can't replace the persisted object by the new 
one, because I might loose references to/from it... I will need to walk 
through all attributes compare them and replace just different ones?!
I feel like the whole approache is wrong and slow, isn't it? Wouldn't it 
be better to just parse the request's json into a JSONObject and do the 
synching after I located the persisted Object based on some hash values 
or id provided?

How do your strategies look like? I currently feel like producing too 
many temporary and unneeded objects.

Creade, Delete and Replace do not really provide such "imagination" 
issues like the Update... do they?

Any push into the right direction is highly appreciated!
Thanks and have fun at FAST if you'll be there!
Sebastian


More information about the Glass mailing list