[#88,backend][s]: add __type__ attribute to all backends to identify them and provide a more robust and generic way to load backends from a string identifier such as that __type__ field.

* Also remove recline.Model.backends registry as can be replaced with this more generic solution.
* This refactoring is necessitated by our need to serialize backend info for save/reload of a dataset and explorer state in #88.
This commit is contained in:
Rufus Pollock
2012-04-15 22:19:43 +01:00
parent 002308f78f
commit 7743534eac
11 changed files with 80 additions and 23 deletions

View File

@@ -103,6 +103,16 @@ test('Dataset _prepareQuery', function () {
deepEqual(out, exp);
});
test('Dataset _backendFromString', function () {
var dataset = new recline.Model.Dataset();
var out = dataset._backendFromString('recline.Backend.Memory');
equal(out.__type__, 'memory');
var out = dataset._backendFromString('dataproxy');
equal(out.__type__, 'dataproxy');
});
// =================================
// Query