CMD and AMD

Source: Internet
Author: User

CMDis the domestic Yuber in the development SeaJS of the time proposed, belong to CommonJS a specification, in addition AMD , its framework isRequireJS。

Similarities and differences between the two:

  1. Both are an implementation of asynchronous (Asynchronuous Module Definition);
  2. CMDAnd is a AMD CommonJS normative implementation of the definition, RequireJS and is the SeaJS corresponding practice;
  3. CMDand AMD the difference: the CMD equivalent of on-demand loading, the definition of a module does not need to immediately set up a dependency module, when needed require can be, more convenient, but AMD instead, the definition of modules need to develop a dependency module, and introduced into the factory by means of formal parameters.

AMD Mode definition module define ([' Dep1 ', ' Dep2 '],function (DEP1,DEP2) {     //internal can only use the developed Module      return function () {};}); /cmddefine (function (require,exports,module) {   //here if you need an XX module, you can introduce   var xx=require (' xx ');});

CMD and AMD

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.