[Telepathy] Uniqueness of objects

Simon McVittie simon.mcvittie at collabora.co.uk
Fri Oct 3 05:18:49 PDT 2008


On Fri, 03 Oct 2008 at 15:05:32 +0300, Olli Salli wrote:
> On Fri, Oct 3, 2008 at 1:31 PM,  <mikhail.zabaluev at nokia.com> wrote:
> > Can you simply protect the constructor and create Connections only through the ConnectionManager?
> 
> I'll look into this. Thanks for the suggestion. However, note that
> using ConnectionManager isn't the only way to get a Connection

My objection to a similar thing in telepathy-glib (apart from the fact
that it would be an API break, and the fact that GObject doesn't really have
private/protected constructors) is that TpConnection is subclassable.

Back to the "two duelling components" situation - if one component wants
a MyConnection (a subclass of TpConnection) and the other wants a
YourConnection (another subclass), for the same underlying Connection,
then it's unacceptable to give them both the same object.

So, I need to have an object (or maybe just a struct) which can't be
subclassed, helps the TpConnection to do the refcounting, and
is instantiated at most once per (DBusConnection, Connection) tuple.

    Simon
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 155 bytes
Desc: Digital signature
Url : http://lists.freedesktop.org/archives/telepathy/attachments/20081003/93e23463/attachment.pgp 


More information about the Telepathy mailing list