In a future release, some thought should be put into creating a 
datasource abstraction API into which all kinds of datasources (such as 
a directly connected SQL database, a couchDB, an XML database such as 
eXist or Xindice, etc... ) can be plugged into. Together with a decent 
cryptographic library, there should be a way of being able to get rid of 
middleware and let the client handle the datasource directly. Even 
though the RPC classes and the jsonrpc backend work very well, I find 
that (abstract) backend support is still not  developed enough in the 
current architecture, which leads to a lot of different custom solutions 
and a constant reinventing of the wheel. I try to solve some of the 
common backend/frontend application tasks with the qcl library, but 
certainly not very well and it is just another "reinvention of the 
wheel" for things that should work out of the box... Just my 2c.

Christian

> Great stuff! I wonder, though, how to get around the problem that the 
> password to access the database is in the javascript source? I guess you 
> need to send the user-supplied authorization data with each request and 
> let the couch server handle authorization issues - I saw that you can do 
> this through server-side javascript logic...
>
> Ralf Nieuwenhuijsen schrieb:
>   
>> Well, the code is going great.
>>
>> I'm designing the api to allow different levels of easy and flexibility:
>>
>>  - very manual: creating a server and a request object
>>
>>    var myServer = new couch.Server('localhost', 1234, 'user', 'password');
>>    myServer.setTimeout(1000);
>>   
>>    var req = new couch.request.CreateDatabase(myServer, "mydatabase");
>>    req.addEventListener("database-created", function (e) { ... }):
>>    req.addEventListener("database-exists", function (e) { .. });
>>
>>  - less manual: automatic server parsing
>>
>>    var req = new 
>> couch.request.CreateDatabase("user:[EMAIL PROTECTED]:1234", 
>> "mydatabase");
>>    req.addEventListener("database-created", function (e) { ... }):
>>    req.addEventListener("database-exists", function (e) { .. });
>>
>> - easier: not messing with request-objects yourself
>>
>>    var myServer = new couch.Server ('localhost', 1234, 'user','password');
>>    var myDb       = myServer.database('mydatabase');
>>    myDb.addEventListener("created", function (e) { ....  });
>>    myDb.addEventListener("exists", function (e) { .... });;
>>    myDb.create();
>>
>>  - easier: automatic server parsing
>>
>>    var myDb       = new couch.Database('mydatabase', 
>> 'user:[EMAIL PROTECTED]:1234');
>>    myDb.addEventListener("created", function (e) { ....  });
>>    myDb.addEventListener("exists", function (e) { .... });;
>>    myDb.create();
>>
>> - a little persistance: create an object based on the value of  the 
>> 'type', setting the public properties
>>
>>    var myDb   = new couch.Database('mydatabase', 
>> 'user:[EMAIL PROTECTED]:1234');
>>    var myDoc = myDb.document('some-doc-id');
>>    mydoc.addEventListener ('instantiated', function (e) { ...  });
>>    mydoc.addEventListener ('invalid', function (e) { ...  });
>>    mydoc.requestInstance();
>>
>> - easy persistance: use a mixin to give any object toCouch() and 
>> fromCouch()
>>   
>>    qx.Class.define("custom.Person",{
>>      extend: qx.core.Target,
>>      uses: couch.MPersistance,
>>
>>      properties:
>>      {
>>         name: { type: "string"; nullable: true },
>>         email:  {type: "string", nullable: true }
>>      }
>>   });
>>
>>   couch.Persistance.getInstance().setDatabase('people','localhost:1234');
>>   var P = new custom.Person();
>>   P.set({name: 'John Doe', email: '[EMAIL PROTECTED]'});
>>   P.toCouch();
>>
>> Most code, except the persistance part, is done now, but i need to do 
>> a lot of testing to make sure everything works as it is supposed to.
>>
>> Any thoughts?
>>
>> Greetings,
>> Ralf
>>
>>     


-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to