Search code examples
alljoyn

Which is better for alljoyn application, Alljoyn Observer listener or About Listener + Session Listener


Which is better for alljoyn application, Alljoyn Observer listener or About Listener + Session Listener? I am new to alljoyn, I see Observer takes care of session management and reduces the application overhead? Is that correct, which is better approach? Please clarify.


Solution

  • Yes, with Observers you don't need to care about session management and definitely reduce your app's complexity. You only need to specify with Alljoyn interfaces you are interested on and the framework will automatically create proxy bus objects that implement at least the interfaces you specified.

    Providing a listener through the registerListener method, you can be notified when a new object is discovered or when the object has been lost.

    With about listener registered to the bus attachment plus session listener you can achieve the same of the Observer, but you have a fine grained control over the connection against the remote object.

    That said, the best approach depends on what you have to do. In any case, starting with Observer might have a smoother learning curve.