[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freedesktop-dbus
Subject:    Re: DBUS service using glib: question
From:       Havoc Pennington <hp () redhat ! com>
Date:       2006-06-25 17:29:33
Message-ID: 449EC7FD.1020106 () redhat ! com
[Download RAW message or body]

Thiago Macieira wrote:
>> - I register a main object with a connect method which returns an ID to
>> the client. The connect method also create and register a new object
>> just for this client which is stored in a list. The client, using the ID
>> can get the remote object and use it. Signals and method on this object
>> will have special effects depending on what the client does with it and
>> not interfering with what other clients does with other objects.
>> - The main object has also a disconnect method which takes the ID in
>> param and remove all data related to this client.
>>
>> Is that the good way ? Does someone knows if other projects does the
>> same thing, like that I can see how they do...
> 
> Yes, that makes sense. In fact, this is what I recommend as a proper OOP 
> approach.

A couple details that might help:
  - of course you probably want to watch for the client's unique name 
vanishing and automatically clean up after the client if it does
  - you probably don't need a custom ID thing, because you can use
a client's unique name, or you can generate an object path for unique 
ids on the server side

Havoc


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic