Why a dispatcher

Because you may want to have multiple handlers, protected in different ways, as described in Handler for cScriptDbCom requests you need to centralize ‘air traffic control’ for the one or more scriptDB instances you want to access with the VBA API
The dispatcher needs a library reference for each scriptDB it will control access to. The Handler will ask the Dispatcher for a reference to a particular named library’s (or a default) scripDB. This is the only role of the dispatcher. Every scriptDB that is referenced by the dispatcher needs to contain this function.
function showMyScriptDb() {
  return ScriptDb.getMyDb();
}

Typical dispatcher code

As in this case, the default scriptDB (could be the only one if you prefer) scriptDB is the dispatcher’s own

function getDb(library) {
  if (library)  {
    return eval((library + "."  + "showMyScriptDb"))();
  }
  else {
    return ScriptDb.getMyDb(); 
  }
}

The role of the dispatcher


You can get me on Twitter or the forum, and compare this topic with parse.com – nosql database for VBA and parse.com – noSQL database for GAS so you can see more about choosing about which noSQL database to use.
For help and more information join our forum, follow the blog, follow me on twitter