[Glass] how to update models properly

Dale Henrichs via Glass glass at lists.gemtalksystems.com
Wed Oct 29 10:17:16 PDT 2014


Sebastian,

With tODE I've taken the approach to build a thin client where the updates
to server objects are done by essentially making RPC calls using blocks and
STON ....

If I were to map this to an web client, I would concoct a JSON packet that
referenced various server-side blocks and pass the arguments to the blocks
using JSON to serialize the arguments ...

Then instead of passing "copies" around, you would basically be sending
update messages "directly" to the objects on the server, so you'd only
update the fields that were intended to be updated ...

It's basically a form of the Seaside-style of associating continuation
evaluation with a link on a web page, but using a block instead of a
continuation ...

Dale

On Wed, Oct 29, 2014 at 9:23 AM, Sebastian Heidbrink via Glass <
glass at lists.gemtalksystems.com> wrote:

> 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
> _______________________________________________
> Glass mailing list
> Glass at lists.gemtalksystems.com
> http://lists.gemtalksystems.com/mailman/listinfo/glass
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gemtalksystems.com/mailman/private/glass/attachments/20141029/599f45d3/attachment-0001.html>


More information about the Glass mailing list