FatFractal customer forums



Author Topic: Grabbags... do they really need to be explicit in code?  (Read 5137 times)

gkc

  • Administrator
  • *****
  • Posts: 375
    • View Profile
Re: Grabbags... do they really need to be explicit in code?
« Reply #15 on: March 22, 2014, 06:48:58 PM »
FYI: Release will be happening at around midnight pacific time tonight.

gkc

  • Administrator
  • *****
  • Posts: 375
    • View Profile
Re: Grabbags... do they really need to be explicit in code?
« Reply #16 on: March 23, 2014, 06:27:38 AM »
Update: Latest software has been released to our "sandbox". SDKs and desktop runtime will be available for download at approximately 3pm GMT / 11am Eastern time / 8am Pacific

gkc

  • Administrator
  • *****
  • Posts: 375
    • View Profile
Re: Grabbags... do they really need to be explicit in code?
« Reply #17 on: March 23, 2014, 01:06:59 PM »

gkc

  • Administrator
  • *****
  • Posts: 375
    • View Profile
Re: Grabbags... do they really need to be explicit in code?
« Reply #18 on: March 23, 2014, 02:12:27 PM »
Released.

See specifically http://www.fatfractal.com/prod/linked_files/FF-IOS-Framework-Docs/html/protocol_f_f_serialization_protocol-p.html ... just implement the ff_shouldSerializeAsSetOfReferences: method in your class, and have it return YES for the properties which are grab-bags where you just want to sync all of the entries each time you modify the 'parent' object

« Last Edit: March 24, 2014, 07:08:43 PM by gkc »

jonnycools

  • Jr. Member
  • **
  • Posts: 74
    • View Profile
Re: Grabbags... do they really need to be explicit in code?
« Reply #19 on: March 23, 2014, 02:38:45 PM »
Does this work for moving an object from the array if it was previously retrieved from a fatfractal instance?

jonnycools

  • Jr. Member
  • **
  • Posts: 74
    • View Profile
Re: Grabbags... do they really need to be explicit in code?
« Reply #20 on: March 23, 2014, 02:51:50 PM »
Or does it just keep the array synced via PUT

gkc

  • Administrator
  • *****
  • Posts: 375
    • View Profile
Re: Grabbags... do they really need to be explicit in code?
« Reply #21 on: March 23, 2014, 04:02:25 PM »
The exact behaviour is, the SDK adds something like the following to the JSON that it sends to the server
Code: [Select]
{
  ffGbItems: {
    classes: [
      "/ff/resources/IOS_CRClasses/Chemistry_101",
      "/ff/resources/IOS_CRClasses/Physics_101",
      "/ff/resources/IOS_CRClasses/Biology_101"
    ]
  },
  studentName: "Gary",
  clazz: "CRStudent"
}
The server assumes that what it's being sent is the complete current state; it will therefore remove any grab-bag items which previously existed but are no longer in what the client sent, and will create any grab-bag items which don't currently exist but do exist in what the client sent. Grab-bags which are absent from what the client sends, are not affected. For example in this case let's say the student had another grab-bag called 'assignments', which is not being serialized "inline" - then the contents of that grab-bag are not modified.

Hope that clarifies

- Gary

PS Have already had some people ask if this same behaviour is available server-side - currently the answer is no, but I am thinking of maybe adding it in the next minor release

jonnycools

  • Jr. Member
  • **
  • Posts: 74
    • View Profile
Re: Grabbags... do they really need to be explicit in code?
« Reply #22 on: March 23, 2014, 05:57:50 PM »
This behavior is perfect. Server side would be nice so I can do big operations.

drdaz7

  • Newbie
  • *
  • Posts: 34
    • View Profile
Re: Grabbags... do they really need to be explicit in code?
« Reply #23 on: March 23, 2014, 06:49:41 PM »
Congrats on the release!

And I'm looking forward to playing more with it... so far it looks really good :)

gkc

  • Administrator
  • *****
  • Posts: 375
    • View Profile
Re: Grabbags... do they really need to be explicit in code?
« Reply #24 on: March 23, 2014, 08:58:38 PM »
Thanks! And, glad it works well for you. Now, back to websockets :-)

jonnycools

  • Jr. Member
  • **
  • Posts: 74
    • View Profile
Re: Grabbags... do they really need to be explicit in code?
« Reply #25 on: March 24, 2014, 08:08:51 PM »
Wow, wow, wow. You shouldn't tease on web sockets

 

Copyright © FatFractal customer forums