the sharing of process sets and named selections between a client process and 
its server twin process seems to me like a very deliberate feature.

http://doc.4d.com/4Dv15/4D/15.6/4D-Server-Sets-and-Named-Selections.300-3838966.en.html

for those who are not familiar with this feature,
a process set created on the client side is visible and available in its server 
twin process, and vice versa.

the reason I say it must be deliberate is because the request log clearly shows 
that a copy is performed to make this implicit feature work.

objects are references, so there is no "sharing" across machines.
someone needs to marshal and copy it over the network.

when you pass an object or collection to a method executed on the server, (or 
the other way round, execute on client)
an implicit VARIABLE TO BLOB is performed.

what is different in v17 to is that references "internal" to that object is 
replicated.
that was not the case in v16; it was more like strigification.

one example of an internal reference is a recursive object.

cat:=New object
kitten:=New object("mother":cat)
cat.kitten:=kitten

in this example we have 2 objects, one inside the other.
but the inner object has a recursive reference to the outer,
so a stringified version would go on forever,

cat.kitten.mother.kitten.mother.kitten.....

v17 can BLOB-ify this kind of object and pass it to a method executed on the 
server.
it can also save it to a field, or a file, and restore it as a recursive object.

another example is multiple referencing of the same internal object.

cat:=New object("food":"tuna")
cat:=New collecrtion(cat;cat;cat)

in this example we have 2 objects, one inside the other.
but the inner object is referenced multiple times.
if the object is stringified, it would look like there are 4 objects. (3 + 1 
collection)

[{"food":"tuna"},{"food":"tuna"},{"food":"tuna"}]

and parsing it would indeed create 4 objects.

v17 can BLOB-ify and restore these kinds of objects, keeping its internal 
references.

so if the recipient method executed on server does

cat[0].food:="prawn"

all 3 instances of cat.food would be updated, because they all reference the 
same object.



**********************************************************************
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**********************************************************************

Reply via email to