XML-RPC Question

Brian Quinlan brian at sweetapp.com
Fri Mar 15 04:03:51 EST 2002


Jesper Olsen wrote:
> Yes that works too.
> I think it would be useful if the register_instance, registered
> the name of the object as part of the method names, e.g.
> 
> server.register_instance(MyClass(), "myob")

You can create arbitrary hierarchies pretty easily using classes (not
tested):

class Container:
	myobj = MyClass()
 
server.register_instance(Container) 

> It would then be clear to the client, that it is calling methods
> on an object:
> 
>     server.myob.helloWorld()
>     server.myob.echo()
> 
> I this example it does not matter much, but usually objects have a
> state, whereas function calls give the impression of something
state-less.
> Of course the same can be achieved by registering these functions
> individually:
> 
>    server.register_function(myob.helloWorld, "myob.helloWorld")
>    server.register_function(myob.echo, "myob.echo")

I'm not sure that people have this sort of expectation. I certainly
don't.

Cheers,
Brian





More information about the Python-list mailing list