Justin,
These are good questions. I will answer them according to the philosophies that I use in my own Kernel projects.
Regarding MVC
I would not make a direct comparison as it is a different way of thinking. Definitely don't try to "fit" an MVC programming style into a Kernel project. The concept behind Kernel is very simple as Nicholas has probably discussed with you since it was patterned after his talk. Modules are generally single operating units. They can contain their own data or receive data through the events they listen to. You could also have data live in some namespaces on your hub if you want. But don't try to pigeon hole any one part of Kernel to any one part of MVC.
Globals
If by global you mean you need access to the variable from anywhere in the code then I would store it in the Kernel and provide a reference to it in the hub. This makes it easy to access from anywhere. Here is an example:
Kernel.extend(Kernel, {
globals: { ... }
});
Kernel.extend(Kernel.hub.get('main'), {
globals: Kernel.globals
});
Kernel.module.define('MyModule', {
init: function() {
// this.hub.globals
}
});
Alternatively you can just store it on the hub which is accessible from Kernel as well as the modules.
APIs
Apis that are meant to be used by modules should be accessible from the hub. The easiest way to do this is to define them as hub extensions. I usually keep hub extensions in their own files. Here is an example:
// hub.util.js
Kernel.extend(Kernel.hub.get('main'), {
// namespace
util: {
myMethod: function() { ... }
}
});
Then the module file would look like this:
// MyModule.js
Kernel.module.define('MyModule', {
init: function() {
this.hub.util.myMethod();
}
});
Abstracting Base Libraries
Doing this requires a pretty good investment as there is a lot base libraries have to offer. So before you do so I would evaluate your need to swap out the base library at a future point in time. Weigh that need against the cost of abstracting the base library. I have not abstracted the base library on any of my projects so far, and I have used jQuery in all of them. In my case the need to replace jQuery with something else was simply non existent.
If you do not abstract the base library you have the advantage of using any base library dependent widgets directly in your modules. This is very handy, but would of course be problematic if you did need to change the base library later. On the flip side, if you abstract the base library then you need to make custom widgets that use your abstraction. This is more work up front but does allow you to swap out the base library without touching the widgets.
And finally, yes, you would put the abstraction in Kernel and then reference it in the hub.
Hope this helps, let me know if you have any other questions.
Alan