Home
Extended ECM
API, SDK, REST and Web Services
Suggestion Assoc Clarification...
unknown
Message from Sean M Alderman via eLinkGreetings, Last fall I attended the Builder Fundamentals class and have beenwriting various custom modules as necessary for NASA Glenn's Livelinksystem since then. I have recently run across something which I foundto be very confusing about the Assoc built-in. I'd like to suggest thatthis be better documented and discussed in the Builder class. Thisissue is that Assoc's are actually pointers/references. I have foundseveral instances in Stock modules where code like this exists -/////function xyz(Object prgCtx, Record request, Assoc response)Assoc data...data = response.data.../////At first glance, I envisioned the Assoc data being a local variablewhich stored a copy of what resides in response.data. This is not thecase as far as I can tell, instead data is really a reference toresponse.data, and thus modifying data modifies response.data.This is not the first time I have noticed this, but I guess it's thefirst time that I've worked on a module where response.data wasimportant for my needs...needless to say I spent quite a bit of timethis weekend mulling over code print outs trying to figure out how datawas being passed back and forth between two functions.Thanks...and I hope at least a note about it can be put into theBuilt-Ins/Assoc section of the Builder documentation for future Oscriptnewbies.-- Sean M. AldermanITRACK Systems AnalystPACE/NCI - NASA Glenn Research Center(216) 433-2795
Find more posts tagged with
Comments
There are no comments yet