[Zope] [Fwd: Re: Zope Solution]
Philipp Auersperg
phil@bluedynamics.com
07 Dec 2001 22:38:24 +0100
ok,
there exist some main differences to things like CORBA or DCOM:
0. XMLRPC is more simple, sort of out-of-the-box
you dont need very complicated Object Request Brokers for
your client.
You just need xmlrpclib.py, a small 20 K beast in your PythonPath,
- no install of complicated ORB's on the client-side.
with python >= 2.0 xmlrpclib is included
1. XMLRPC itself is (only) late-bound -
with CORBA and DCOM you define interface by writing .idl
definition files and generate stub classes that you use
inside your client.
DCOM can be also be used late-bound, I dont know about
CORBA in that matter.
when your call to te server does not match to ot's interface
the error occurs an run-time.
This feature is not difficult to
live with for Python programmers, at least for me 8-)
2. Since XMLRPC is transported by HTTP it is stateless.
when you do this:
ob=xmlrpclib.Server('.........')
ob.doThis()
ob.doThat(bla,blorf)
res=ob.getSomeResult()
in CORBA/DCOM it creates an object reference that is held
on the server-side during the whole transaction and released
when 'ob' comes out of scope or is intentionally released by
the client side.
In XMLRPC the object reference is evaluated for every atomic
call to the server (see xmlrpclib.py for better understanding).
the xmlrpclib.Server(...) just prepares the URL used by
xmlrpclib, it is not a real call to the server !!
so in XMLRPC you have to design your Server so that
transactions have to happen within a single call to the server.
If you know that you can deal with it.
3. Performance.
well, for every call xmlpclib has to marshal and unmarhal
( thats the most effort ) your method calls as XML chunks.
by default xmlrpclib uses xmllib.XMLParser (slow, but buiilt-in).
but you can tune xmllib by using sgmlop (speeds up marshalling
to 10-15x)
xmlrpc fits perfect for remote calls where you have few
calls to functions to the server where each function
runs long compared to the transport time.
Design your interface so, that transactions can be done
within single calls to the server !!
If you keep these primciles in mind xmlrpclib can make life easy!
phil
Am Fre, 2001-12-07 um 19.33 schrieb Jason Earl:
>
> Hmm... I actually know *how* to use XML-RPC, in fact I think that it
> is incredibly slick. Currently I am using it to enter email messages
> into a PostgreSQL database. I already had the logic to do this in
> Zope, and so it seemed a shame to not reuse it.
>
> So far this has worked really well, but I was concerned about how well
> tested this sort of thing is, and how well it scales.
>