[sugar] Reducing activity sharing boilderplate code

Tomeu Vizoso tomeu at tomeuvizoso.net
Fri Nov 7 11:54:27 EST 2008


On Fri, Nov 7, 2008 at 1:41 PM, Morgan Collett <morgan.collett at gmail.com> wrote:
> I want to push some of the code required for sharing into
> sugar-toolkit, for example:
>
>    def _list_tubes_reply_cb(self, tubes):
>        for tube_info in tubes:
>            self._new_tube_cb(*tube_info)
>
> If I put this directly into sugar.activity.activity.Activity, then all
> activities will gain the code which might impose some overhead.
>
> Alternatively I can subclass Activity to SharableActivity or something
> like that, and add the telepathy/tubes helper code in there.

If we make activities subclass SharableActivity, then they won't be
able to subclass WebActivity, RedActivity, QTActivity, etc

IMO, the alternative that is looking best right now is to have in
sugar.activity.activity the bare minimum an activity needs to load (a
window). Then add services like SharingService, JournalService, etc
that can be used by the activities that actually need them, and loaded
when they are actually needed.

This is the approach followed in XULRunner and in Maemo, AFAIK.

Regards,

Tomeu


More information about the Sugar mailing list