RPCXML hide implementation.

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • x_O

    RPCXML hide implementation.

    Hi

    I'm working recently with XMLRPC for python and It never was so easy.

    But I've meet a obstacle. Because python is not giving us any
    reasonable encapsulation mechanism, I have problems with hiding some
    part of the implementation.

    When class has 2 methods and I want to make rpc private only ONE of
    them. I can always use __name. But what in case when I really need to
    use those two methods inside other class as a public, but not by RPC

    Simple code:
    class RpcClass:
    def one(self): #visible by RPC, available as public for other class
    return "one"
    def two(self): #INVISIBLE by RPC, available as public for other
    class
    return "two"

    Server.register _instance(RpcCl ass())

    Thanks
  • skip@pobox.com

    #2
    Re: RPCXML hide implementation.

    xSimple code:
    xclass RpcClass:
    x def one(self): #visible by RPC, available as public for other class
    x return "one"
    x def two(self): #INVISIBLE by RPC, available as public for other
    xclass
    x return "two"

    xServer.registe r_instance(RpcC lass())

    Just register the method you want to publish, not the entire instance.

    Skip

    Comment

    Working...