Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7419355
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T08:03:21+00:00 2026-05-29T08:03:21+00:00

I have been reading about how the dojo 1.7 loader uses an AMD API/framework

  • 0

I have been reading about how the dojo 1.7 loader uses an AMD API/framework here and here too, and I came across this quote on one of the slides: “AMD(’s) greatest benefit isn’t being able to load scripts on-demand, as some people may think, the greatest benefit is the increase of the code organization/modularity and also the reduced need for globals/namespacing.” But my question is, can’t global variables already be avoided by using normal js functions, and maybe dojo.hitch() if you need to access another function’s execution context (and another function’s ‘private’ variables)? Put another way, other than asynchronously loading only what you need, what is the benefit of the AMD framework?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T08:03:22+00:00Added an answer on May 29, 2026 at 8:03 am

    The benefits of AMD are the benefits of having a module system, analogous to a namespace system in other languages. In JavaScript, we often faked this with global variables, but modules give a number of specific benefits:

    These modules are offered privacy of their top scope, facility for importing singleton objects from other modules, and exporting their own API.

    — From the CommonJS Modules/1.1.1 spec, which started it all.

    Key here is the import and export facilities. Previously everyone was doing this ad-hoc, with globals (like window.jQuery, window._, etc.). To get at jQuery’s exported functionality, you had to know the magic name, hope nobody conflicted with it, and be sure that the jQuery script was loaded before your script. There was no way of declaratively specifying your dependency on jQuery, and jQuery had no way of saying “this is what I export” apart from just stuffing them onto a global window.jQuery object.

    A module format fixes this: each module exports specific functions, e.g.

    // math.js
    define(function (require, exports, module) {
        exports.add = function (a, b) { return a + b; };
    });
    

    and each module can require specific other modules, e.g.

    // perimeter.js
    define(function (require, exports, module) {
        var math = require("math");
    
        exports.square = function (side) {
            return math.add(math.add(side, side), math.add(side, side));
        };
    });
    

    On why AMD should be the module system of choice, James Burke, the author of RequireJS—an AMD loader much like Dojo has—wrote a blog post detailing why he thinks AMD is the best.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been reading about garbage collection and came to know the term Island
I have been reading about this but I have to do some thing. I
I've only just really started android developing and have been reading about services here
I have been reading about creating an RPM for Python 2.6.4. In this page:
I have been reading about entity framework over the past couple of days and
I have been reading about this Sony vs GeoHot case. I however don't understand
I have been reading about the Play Framework. It is said to be pretty
I have been reading about how to build plug-ins and this MIME type keeps
I have been reading about the differences between Table Variables and Temp Tables and
I have been reading about collision detection in games on stackoverflow and other sites.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.