The documentation states what Code Attachment could be used for ("helpful if you are sharing a sample or a configurable app...") but it isn't clear on what it must be used for.
For example, I host a Javascript application on my own domain which does the following:
1) Fetches a Web Mapping Application item from ArcGIS Online
2) Reads the content of this item (the item's content is JSON configuration for my app which includes a reference to a WebMap
3) Applies the configuration that was read from step 2
4) Displays the referenced WebMap.
My scenario involves wanting my app to provide some additional tools when interacting with the WebMap. I have decided to factor out this Javascript code separately from my main Javascript application for my own reasons. If I zip up my factored out Javascript that provides the additional functionality, attach it as a Code Attachment to the Web Mapping Application referenced in step 1, my steps above would become the following:
1) Fetches a Web Mapping Application item from ArcGIS Online
2) Reads the content of this item (the item's content is JSON configuration for my app which includes a reference to a WebMap
3) Download the Code Attachment Zip in the browser
4) Applies the configuration that was read from step 2
5) Unzip the Code Attachment in the browser and run the containing Javascript
6) Display the referenced WebMap with additional tools provided by the Javascript from step 5.
Is this an acceptable use of the Code Attachment item?
Thank you