Dbus Object Extension/Inheritance in Python

Robert Rawlins robert_rawlins at hotmail.com
Wed Feb 13 02:05:05 PST 2008


>> I've got a few classes in a dbus library which I want to add additional functionality too and wanted to get your opinions on the best way to do this. 
>> Generally when working with standard Python classes I would simply inherit from the base class, however, I wonder if this is possible from a dbus 
>> object? or should I be looking at creating proxy objects or using a decorator pattern?
 
Hello People,
 
I'm still not making much headway on the best way to implement this. The basic premise of what I want to achieve is a python object which acts the same as an existing dbus service object but allows me to add additional functions and methods. The existing library has asynchronous calls and sends back signals.
 
Like I said before, I've done work with inheritance before on standard python classes but I'm not aware of how best to implement this kind of behaviour with dbus. I've looked through a few tutorials and API documents on the web but couldn't really find any decent conclusive examples of what I want to do.
 
I suspect in an ideal world I would just pass the object path of the object to be inherited into my own custom sub class and it would return an instance of the subclass, with all the inherited method of its base.
 
Is inheritance really what I need? or should I be looking at building my own dbus service which implements the interface for the base dbus object? and I replicate all the method names in my own class and just pass requests off to the subclass? that just seems very verbos and I would like to think there is a cleaner way to do it.
 
Thanks for any help guys,
 
Robert
_________________________________________________________________
Share what Santa brought you
https://www.mycooluncool.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freedesktop.org/archives/dbus/attachments/20080213/3603e5d3/attachment.htm 


More information about the dbus mailing list