XML-RPC interface

Linas Vepstas linas@linas.org
Wed, 26 Sep 2001 09:21:17 -0500


On Tue, Sep 25, 2001 at 10:02:40PM -0700, Dave Peticolas was heard to remark:
> On Tue, 2001-09-25 at 21:54, Rob Brown-Bayliss wrote:
> > On Wed, 2001-09-26 at 15:00, Linas Vepstas wrote:
> > 
> > > What I keep trying to say is that most people should *not* look at the
> > > backends at all.  Its clear that we still need to implement one or two
> > > more, so that we can really have a generic server.   But ordinary
> > > 'users' should be coding to the engine api.  The backends are supposed
> > > to be off-limits, and have a kind-of special relationship with the
> > > engine.
> > 
> > Having an xml-rpc server (or I guess in this case it's a xml-rpc client
> > in place of a gui client) sitting on a machine, talking directly to the
> > engine would allow incorporating gnucash into other apps...  for example
> > (close to my heart) a POS system could use gnucash as the accounting
> > system, leaving it free to deal with sales and stock management.
> > 
> > The site would then stil be able to choose either a postgres or file
> > based back end.  The advantage as I see it of an xml-rpc connection is
> > every language would then magiacally work with gnucash, rather than
> > messing about wraping the current engine calls every time they change.
> 
> Yes, precisely. XML-RPC is definitely too heavyweight for
> some applications, but for low-bandwidth needs, it is a
> very flexible (and simple) solution.

The disadvantage is that you loose caching (the responses are always
slow, because they always go over the network), and you loose the
potential of off-line operation.

The 'slow' issue shouldn't be underesimated.  To display a transaction,
you need to make dozens of calls: 'get date', 'get description' 'get
amount', etc. etc.  If each call took even 100 millisecs, it would take
a few seconds just to display one transaction.   If each call took
only 10 millisecs, then it would take a few seconds to display ten
transactions. Forget 100.

Ping the nearest router.  I doubt you'll get ping times of less than
10 millisecs.  When I ping the other end of my DSL line, I get 35
millsec. 


I also think you overestimate how hard it is to get other language
bindings.   At least with swig, its essentially a no-op.  You run swig,
you've got bindings.  You're done.  

--linas


-- 
pub  1024D/01045933 2001-02-01 Linas Vepstas (Labas!) <linas@linas.org>
     Key fingerprint = 8305 2521 6000 0B5E 8984  3F54 64A9 9A82 0104 5933