GObjectification of protocols

Tomasz Wasilczyk tomkiewicz at cpw.pidgin.im
Mon Aug 19 12:54:13 EDT 2013


18 sie 2013 21:53, "Ankit Vani" <a at nevitus.org> napisał(a):
> This makes using smaller interfaces for convinience not necessary, but it
may
> still be appealing if we want PurpleProtocolInterface to not be so huge.

I like the idea of small interfaces. But you should pick carefully, which
methods should stay in main class.

Also, I think there should still be some padding bytes, in case of any
unexpected upgrades, that should stay in the main class.

>
> > Is it possible to set the function pointers using a similar system as
you
> > have for the plugin information (with the key-value pairs), or does
that not
> > good form in a gobject system?
>
> The key-value pairs are provided during instantiation of an object, not
the
> type. So, everytime when creating an object of XMPPProtocol (protocols
may be
> unregistered and registered again and again by plugin reloads in case of
> third-party stuff), we would need to provide all the functions. And then
when
> creating an object of GTalkProtocol, we would again have to provide all
the
> functions to instantiate that protocol object.
>
> However, by using interfaces, we set the functions during the
initialization of
> the type. So, when the XMPPProtocol type is initialized, its functions
are set.
> And if GTalkProtocol has to inherit XMPPProtocol, it has to set only those
> functions in the interface that are different from XMPPProtocol's
functions,
> since XMPPProtocol's type knows what it implements.
>
>
 - Ankit
>
> _______________________________________________
> Devel mailing list
> Devel at pidgin.im
> http://pidgin.im/cgi-bin/mailman/listinfo/devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://pidgin.im/pipermail/devel/attachments/20130819/683ffa69/attachment.html>


More information about the Devel mailing list