[Bug 26059] Requests Mixin doesn't create Handles on demand

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Sat Apr 17 01:55:55 CEST 2010


https://bugs.freedesktop.org/show_bug.cgi?id=26059

--- Comment #5 from Ed Page <eopage at byu.net> 2010-04-16 16:55:55 PDT ---
(In reply to comment #4)
> Right, butterfly has a handle factory it uses throughout.

For sunshine, butterfly, the one ring, and my pre-alpha bluewire the handle
factory does one thing and exactly one thing, create a handle using handletype
specific parameters.

In my view get_handle_by_name translates handle_type/name to a handle object. 
I think that translation logic from name to handle init parameters belongs in
get_handle_by_name rather than the handle factory.  I used to (no need anymore)
and butterfly currently does translation between name and handle init
parameters.

Having the logic decoupled is nice for when your protocol initiates the
creation of a handle.  You already have the disparate parameters.  Its annoying
to construct them into a name just to have the handle factory decompose them
again into distinct parameters.

> By external API do you mean methods like RequestHandles? Overriding such
> methods is completely normal.

Hmm, my reference in my comment to "external API" was not about overriding but
calling them from within my own CM.  My problems are
1. A personal lack of understanding of dbus bindings and any magic it might do
to the function
2. proper layering
3. keeping the code more decomposed so I don't call these monoliths that do
more than I want.

> My point is that the CM-specific work has already been done in redefining
> RequestHandles -- butterfly does it[0] and sunshine does it[1]. It would be
> nice to not have to have further CM-specific handle functions and re-use the
> ones we already have, no?
> 
> 0.
> http://git.collabora.co.uk/?p=telepathy-butterfly.git;a=blob;f=butterfly/connection.py;hb=HEAD#l251
> 1.
> http://git.collabora.co.uk/?p=telepathy-sunshine.git;a=blob;f=sunshine/connection.py;hb=HEAD#l370

Compared to my branch of tp-python, what parts are butterfly and sunshine
overriding?  Not the whole function.  Its the part of the code in the for-loop
and that is the code I propose be moved into get_handle_by_name.  I would not
want get_handle_by_name to be added just for me but I would expect other CMs to
enjoy my very abstract benefits from it ;)

I noticed sunshine has get_handle_id_by_name.  The two main differences are
1. It returns an id rather than an object
2. It only searches rather than doing a search and a construction.

I can understand wanting (2) and could see this being decomposed in a different
way.

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.



More information about the telepathy-bugs mailing list