<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
FONT-SIZE: 10pt;
FONT-FAMILY:Tahoma
}
</style>
</head>
<body class='hmmessage'>Hi Curtis,<BR>
<BR>> Robert Rawlins wrote:<BR>> > Hello Chaps,<BR>> > <BR>> > I've got a few classes in a dbus library which I want to add additional <BR>> > functionality too and wanted to get your opinions on the best way to do <BR>> > this. Generally when working with standard Python classes I would simply <BR>> > inherit from the base class, however, I wonder if this is possible from <BR>> > a dbus object? or should I be looking at creating proxy objects or using <BR>> > a decorator pattern?<BR>> <BR>> The limitation I ran into is that the published methods are all <BR>> decorated, so you can't replace them directly on an inherited model. <BR>> I've no idea what would happen if you tried and decorated them with the <BR>> same interface.<BR>> <BR>> We work around this by making the exposed methods just call do_FOO <BR>> internally.<BR>> <BR>> --<BR>> Curtis Maloney<BR>> <A href="mailto:cmaloney@cardgate.net">cmaloney@cardgate.net</A><BR><BR>
Thanks for getting back to me about this. I ended up, for the moment just choosing to go for Composition over Inheritance, I appreciate that its not really a best practice in this scenario and isn't the 'proper' way to achieve it but it works for me.<BR>
<BR>
I now just create an instance of the dbus object in my class init proceedure and have a getRealObject() method which returns the composed dbus object for any calls I need to make on the bus.<BR>
<BR>
Cheers Curtis.<BR>
<BR>
Robert<BR><br /><hr />Everything in one place. <a href='http://www.windowslive.co.uk/get-live' target='_new'>All new Windows Live!</a></body>
</html>