//

429
1
08-29-2018 11:56 AM
_____
by
New Member
 
0 Kudos
1 Reply
RobertScheitlin__GISP
MVP Emeritus

Ian,

  These are pretty broad questions.

  • The location of where you define items in your is pretty inconsequential.
  • You should really limit the use of Global vars https://www.w3.org/wiki/JavaScript_best_practices#Avoid_globals 
  • Top down organization is a pretty standard coding practice and it tend to use it all the time.
  • You should consider lazy loading required items that will not be used until something else happens. What I mean by this is if you have a widget/dijit that once the user clicks a button will open a dialog to allow for querying a map service then there is no need to have Query and QueryTask loaded in the main apps require array. Wait until the onClick event of that button is pressed to require those modules, because there is a posibility that the user will never click that button.