The Borg Container Assumptions

“You will be assimilated. Resistance is futile”
Hugh of the BorgĀ 

In my current assignment, I’ve been looking at browser widget frameworks such as OpenSocial and Google Gadget. It seems to me that something is broken in the conceptual paradigms used by these frameworks, as least when applied to the web. They all seem to be based on the idea of a “container” and “apps” (I’ll use app and widget interchangeably) where the container is responsible for loading and configuring apps/widgets. However, in their implementations of containers and apps, these frameworks fall into a set of erroneous implicit assumptions which I call the Borg Container Assumptions1:

  1. The container encompasses the entire page
  2. The container is a singleton
  3. A container is not a widget
  4. A widget cannot exist without a container

Continue reading

Dojo AMD incorporating third party scripts

So, you’ve started using RequireJS or you’ve upgraded to the latest version of Dojo and have converted your web application over to Asynchronous Module Definition (AMD) loading. However, your code still depend on some third party non-AMD scripts. Can and should these scripts be incorporated as AMD dependencies? By “non-AMD” I mean the third party scripts which are not wrapped in a define() or require().


define([ /* ... */], function(){
   //... body of third party script
})

The most important question to answer is: Can you modify the code?

Continue reading