Re: [web2py] Re: xmlrpc backend
I think I will end up just writing my own model for this (a la Anthony's suggestion), but the problem remains that "model" as it relates to web2py presumes SQL, and that fact limits design. While it would be possible to write an XMLRPC adapter to the DAL, that is sort of like jamming a square piece into a triangle hole - more than not you'll probably end up wishing you just used the direct database connection! I think the long term solution to this problem is to decouple the data models from database access. Cheers, Matt On Mon, Sep 26, 2011 at 2:05 PM, Ross Peoples wrote: > Please forgive me if this post shows up a bunch of different times, but I'm > having trouble with Google Groups not posting my replies, even though it > says it did. So for the fourth time: > We could add an XMLRPC adapter to the DAL that instead of making SQL calls, > could build an XML version of the query that could be passed on to another > web2py app via xmlrpc. That app could then return the results as XML, which > is then converted back to Row objects and returned to the application, > making XMLRPC remote database access completely transparent and make things > like SQLFORM.grid work. > The only problem I see (aside from there being a lot of work to do) would be > security. We would have to make web2py apps acts as a db service, like it > does with CAS, and restrict who can access the XMLRPC-DB service. But this > would be VERY cool and extremely helpful in building scalable (multi-tier) > apps. > I would be interested in helping to write code to make this happen.
[web2py] Re: xmlrpc backend
Please forgive me if this post shows up a bunch of different times, but I'm having trouble with Google Groups not posting my replies, even though it says it did. So for the fourth time: We could add an XMLRPC adapter to the DAL that instead of making SQL calls, could build an XML version of the query that could be passed on to another web2py app via xmlrpc. That app could then return the results as XML, which is then converted back to Row objects and returned to the application, making XMLRPC remote database access completely transparent and make things like SQLFORM.grid work. The only problem I see (aside from there being a lot of work to do) would be security. We would have to make web2py apps acts as a db service, like it does with CAS, and restrict who can access the XMLRPC-DB service. But this would be VERY cool and extremely helpful in building scalable (multi-tier) apps. I would be interested in helping to write code to make this happen.
[web2py] Re: xmlrpc backend
It would be really cool if web2py's DAL supported an XMLRPC backend.
[web2py] Re: xmlrpc backend
Others may have more specific advice regarding xmlrpc setups, but in general, you can put whatever you want in your model files, so if you are duplicating code related to processing your xmlrpc calls, you could move it to model files (or to modules and import them). You can also use SQLFORM.factory to take advantage of web2py's forms functionality when there's no database involved -- see http://web2py.com/book/default/chapter/07#SQLFORM.factory. Anthony On Monday, September 26, 2011 11:47:30 AM UTC-4, Matt wrote: > Greetings, > Has anyone successfully used web2py to develop an app that does not > use a database backend, but instead operates on a system using xmlrpc > calls? > > Our current approach was to simply ignore web2py's models completely, > putting all the functionality in the controllers and views. The > problem with this approach is you begin to run into massive > duplication of information that would usually be stored in models. I > am interested specifically in two things: >- encapsulate schema information to (among other things) provide > proper data validation >- ease of form generation > > Implementing a new fake database backend seems to be overkill here > because we only need such a small subset of functionality offered by > the DAL. Any suggestions would be welcome! > > Thank you, > Matt
[web2py] Re: xmlrpc backend
Seems an interesting idea. On Sep 26, 10:47 am, Matt wrote: > Greetings, > Has anyone successfully used web2py to develop an app that does not > use a database backend, but instead operates on a system using xmlrpc > calls? > > Our current approach was to simply ignore web2py's models completely, > putting all the functionality in the controllers and views. The > problem with this approach is you begin to run into massive > duplication of information that would usually be stored in models. I > am interested specifically in two things: > - encapsulate schema information to (among other things) provide > proper data validation > - ease of form generation > > Implementing a new fake database backend seems to be overkill here > because we only need such a small subset of functionality offered by > the DAL. Any suggestions would be welcome! > > Thank you, > Matt