mapping object paths to method calls
Daniel P. Berrange
dan at berrange.com
Sun Apr 9 07:55:38 PDT 2006
On Sun, Apr 09, 2006 at 11:35:38AM +0200, Thiago Macieira wrote:
> Chris Rebert wrote:
> >My application will have a large database of objects accessible via an
> >object path that incorporates their ids (e.g. /org/foo/bar/41254), and
> >even using the flyweight pattern, I believe there would not be enough
> >memory to register an object path for each object, therefore I would
> >like to generate each object on demand if possible, as only a few of the
> >many will be in use at any one time.
> >If you have any ideas on how to accomplish this, I would be most
> >appreciative.
>
> See above.
>
> Registering the object depends on how your binding does it. Technically
> speaking, with a message filter, you could catch the call to any object,
> without the need to call any specific "register object" function.
The Python bindings already have support for exactly this capability. The
ObjectTree class takes a base path, eg /org/foo/bar, and then handles
calls for any object below this point, eg /org/foo/bar/41254 without needing
any of the sub-objects to be explicitly registered - only the base path
is registered.
Regards,
Dan.
--
|=- GPG key: http://www.berrange.com/~dan/gpgkey.txt -=|
|=- Perl modules: http://search.cpan.org/~danberr/ -=|
|=- Projects: http://freshmeat.net/~danielpb/ -=|
|=- berrange at redhat.com - Daniel Berrange - dan at berrange.com -=|
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.freedesktop.org/archives/dbus/attachments/20060409/c691dd5d/attachment.pgp
More information about the dbus
mailing list