Author: Dylan schiann Original article: AMD for the business-side You may have read our latest blog" AMD: the definitive source ". This blog introduces AMD (asynchronous module definition) in detail ). AMD is a technical topic, but this article will focus on what value AMD has for your business. AMD is an emerging factual standard designed to efficiently develop modular JavaScript libraries/applications. Apply Javascript Program Transforming to AMD will bring many advantages to your business. If you are using dojo 1.7 +, you are already using AMD and enjoy the benefits it brings to you. Using AMD in your web applications will greatly improve Code Maintainability, application performance, and interoperability. These will undoubtedly bring the following advantages to your business: 1. Efficient development 2. Better User Experience 3. Advanced Technology
Code maintainability AMD solves many problems in JavaScript and HTML5 development projects by using many best practices. The technical threshold for Javascript development is very low, which often leads to the use of global variables intentionally or unintentionally. The old version of dojo uses namespaces to solve this problem, but namespace is not the best solution. It has a performance impact and is unique. With amd solutions, you will encounter fewer problems during development. In large projects, it is common for different teams to develop different parts of an application/database. AMD can be used to create reusable modules, which can help various project teams/teams save time for code merging and facilitate code sharing. The Code architecture of the amd module can also help reduce the entire development process time. Once a developer has a solid model to write clean and modular code, errors in the development process will be greatly reduced, which will speed up the development of the entire project, improve the development efficiency of the team.
With amd for function detection, you can easily optimize your applications for mobile platforms or remove support for outdated browsers. In addition, the support logic for different browsers is saved in an efficient and easy-to-maintain manner. Once these support is no longer needed, this part of code can be easily removed.
Application Performance AMD and the accompanying application optimization tools can make your application code smaller and directly improve performance. (See business benefits of improving performance) Smaller code means less network bandwidth overhead, faster page loading time, increased user satisfaction, and increased number of users. The asynchronous nature of AMD makes parallel Loading modules possible, further improving the application performance. With AMD, the code size of a typical dojo application can be reduced by 25%-90%, and there are also many examples of increasing loading speed by 5-10 times.
Interoperability The original intention of dojo toolkit is to provide a series of tools and libraries to help developers develop web applications more efficiently. I have never imagined initiating a war between different JavaScript toolkits or forcing users to use only one dojo toolkit and discard other rich modules. We have always believed that users have the right to freely choose the technologies/modules that best suit their projects. AMD can effectively resolve conflicts between different toolkits. It makes it easier to mix modules in different tool kits. For example, you can use the dgrid module in a jquery application or add some mootools functions to the dojo application. However, it is recommended that you exercise caution when loading multiple different toolkits in an application, because this may affect the performance. The entire dojo has become more modular and you can get the benefits of the microtoolkit from it. At the same time, these modules have been fully tested to meet your expectations. AMD has been used by many large companies and organizations, such as IBM, BBC, and Twitter. We look forward to exponential growth in the number of mainstream amd websites used this year.
Summary Code maintainability, application performance, and interoperability provide sufficient flexibility for creating more dynamic applications. AMD has brought us many advantages in these technologies and businesses. Many companies share a common goal: to retain customers as efficiently as possible while ensuring product quality. AMD was born for this, and we are looking forward to its progress.
Additional reading
- AMD: the definitive source
- Beyond dojo: the rise of AMD
- BBC adopting AMD as part of their responsive design efforts
- Twitter article on improving performance, including using amd