[sugar] Activity names vs. types (was: synapse/cerebro)

Sjoerd Simons sjoerd.simons
Fri Jul 25 06:07:03 EDT 2008


On Fri, Jul 25, 2008 at 12:12:20AM -0400, Polychronis Ypodimatopoulos wrote:
> A valid argument. I remember discussing the idea behind this in the past  
> with Michael, but I'm not sure if Sugar landed a decision on this. The  
> activity type is supposed group different activities into a single type  
> based on their capabilities and represent this group with a two-byte  
> field. For example, I wrote an activity that does chat, file sharing and  
> a bidding game. I _believe_ the activity should advertise its  
> capabilities as 'xx' for chat, '\x00\x01' for file-sharing and '99' for  
> the bidding game. The bytes chosen are clearly random, but the idea is  
> that my activity would be able to engage in a chat session with a  
> regular chat activity under the same activity type, or with previous  
> version of itself lacking the file-sharing capability. Maybe this is  
> simply an overkill.

There are various issues here. First is that the activity name as currently
defined doesn't say what actual capabilities an activity has. It refers to a
specific application. This was done because the assumption is/was that the
environment is homogenous and if you missing an activity you will be able to
download it from your friends and/or the server.

I am not sure splitting it up in capabilities makes sense. The bit of
information sugar is interested is in currently, is what application is this
used for a certain activity on the network so it can startup the same activity.
What you don't want is to startup Chat to participate in a drawing session,
because even though the drawing session might have a chat associated with it,
the point is drawing and talking about the drawing, not free-form chatting :)

The other issue with just using two bytes is that there is no central registry,
like we have with port numbers. The idea about using reverse domain names say
like org.my.school.Myname.MyActivity instead of say 42 is that it's a lot
easier to guarantee global uniqueness. If the hitchhickers guide becomes
popular in a school you don't want newly created activities to get all confused
because suddenly everyone is using 42 for their type ;)

> At any rate, I will add (I filed a ticket) a sufficiently large (255  
> chars?) name field for activities, although I would much prefer  
> designing this mechanism properly (any suggestions by Sugar(ed)  
> developers?).

The point of Synapse currently is to have a mostly drop-in connection manager
on top of Cerebro that Sugar can use with minimal changes. So we can judge how
well it works for Sugar.

While the current OLPC telepathy API are definately not perfect (they were
designed when there was still a lot of uncertainty about what sugar was gonna
look like), we do want to keep using them for now. I think nobody is against
refactoring them at some point in the future, but that would be a much bigger
and sugar-wide effort.

  Sjoerd
-- 
I hope you're not pretending to be evil while secretly being good.
That would be dishonest.



More information about the Sugar-devel mailing list