mapping object paths to method calls

Thiago Macieira thiago.macieira at trolltech.com
Sun Apr 9 02:35:38 PDT 2006


Chris Rebert wrote:
>I'm new at D-BUS and was wondering if it is possible to have an object
>path mapped to a method call, e.g. accessing /org/foo/bar/1123 would
>return the result of /org/foo/bar.someMeth("1123"). I couldn't find an
>answer in this list's archives or the documentation, so I'm doubtful
>this is possible.

It doesn't really make sense because an object path by itself is 
meaningless. You must have at least a method name associated in order to 
make anything useful with it.

What you seem to be asking, though, is something like we're used to in 
programming:
  Object obj = someMeth("1123")
  obj.anotherMeth(...)

is that it? Then, if so, there is no problem in your program having a 
method call that returns an object path. The only issue is that the 
object path has to exist at all times. There's no reference counting 
involved here -- unless you provide a Release method and remember to call 
it.

>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.

-- 
Thiago José Macieira - thiago.macieira AT trolltech.com
Trolltech AS - Sandakerveien 116, NO-0402 Oslo, Norway
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/dbus/attachments/20060409/866bf9bd/attachment.pgp


More information about the dbus mailing list