官术网_书友最值得收藏!

Asynchronous Module Definition

Both the ArcGIS JavaScript API and Dojo decided to handle the bloated library crisis by incorporating the concept of Asynchronous Module Definition (AMD). In AMD, a library is broken down into modular components. The developer can pick and choose which parts of library they want to include in the application. By loading only the parts we need, we reduce download times, free the browser memory of unused functionality, and improve performance.

Another advantage of AMD is name collision avoidance or the names of the variables where the libraries load are controlled by the developer. Also, the scope of the loaded libraries is limited to within the calling function, much like a self-executing statement.

In an AMD based application, we make a list of the library modules we want to use, usually in an array of strings that the library knows how to interpret. We then follow it up with a function that loads most or all of those modules into JavaScript objects. We can then use those modules within the function to get the results we want.

主站蜘蛛池模板: 浙江省| 达拉特旗| 永川市| 苏尼特左旗| 松溪县| 永新县| 漳州市| 洛南县| 余庆县| 石河子市| 阜新市| 邯郸县| 平武县| 水富县| 临夏市| 沁源县| 红原县| 黎平县| 巴塘县| 贵德县| 葵青区| 肃北| 犍为县| 阿图什市| 石楼县| 朝阳县| 莎车县| 多伦县| 普定县| 新民市| 年辖:市辖区| 廉江市| 仁寿县| 灵宝市| 靖远县| 滕州市| 伊宁市| 蚌埠市| 讷河市| 温宿县| 读书|