[Sugar-devel] Stateless activties (was Re: Fw: #3013 UNSP: toolbar error)

Gary Martin garycmartin at googlemail.com
Fri Aug 5 17:49:36 EDT 2011


On 4 Aug 2011, at 15:23, James Simmons <nicestep at gmail.com> wrote:

> I am in favor of supporting stateless Activities.

-1

Journal entries are not just old school save files. They are a log/journal of what the child has been doing, even if that didn't lead to explicit state storage. Activities that do not stave state often generate upstream bug reports and confusion, "I've run this activity before, why is the home activity icon still grey?" "Why is there no record of my previous uses of it." type thing.

> There are too many good use cases for them to not support having them.

I'm not convinced. I think it's just that some activity developers haven't though about this Sugar feature enough, or haven't implemented planned features/enhancements (my Moon activity is a good example, it does save state, but is very limited currently). I'm always disappointed when I find an activity not trying to store some useful state.

> The Log Activity is a good example.  There is no much point in having a Journal entry for Log.  Old Journal entries do not point to old logs.  (If they did there might be some point to having them, I suppose).

Activity authors should be thinking about keeping useful state as part of their design process. It would be great if Log journal entries kept the log state so I could easily look back at previous errors after rebooting. Even as it is now I occasionally write some testing notes in the description field for later reference (often I copy/paste a traceback out of one of the actual log files so I can find it later), if the Log entries are now disabled in the next release I'll have to start copying and pasting into Write to keep a record :(

Regards,
--Gary

> Games might do better to save state information in the data directory rather than create a Journal entry, if the state is nothing more than high scores.
> 
> The parameter in the __init__() method looks like it has been there from the beginning of Sugar.
> 
> I don't mind changing the book if that is what needs to be done, but I think the trick documented in the book is worth preserving.
> 
> James Simmons
> 
> 
> On Thu, Aug 4, 2011 at 1:07 AM, James Cameron <quozl at laptop.org> wrote:
> On Thu, Aug 04, 2011 at 10:27:09AM +0500, Sebastian Silva wrote:
> > I just tried Log activity, it does create a Journal entry by default.
> 
> This has since changed.  As I said, look at the Log activity source ...
> sorry I wasn't explicit enough ... in the git repository.
> 
> Specifically,
> http://git.sugarlabs.org/log/mainline/blobs/master/logviewer.py#line329
> is where the activity instructs Sugar not to create a Journal entry by
> default.
> 
> And,
> http://git.sugarlabs.org/log/mainline/blobs/master/logviewer.py#line511
> is where a Journal entry is created as a result of user action.
> 
> Sorry nobody has released a new version of Log yet.  That might be a
> good idea.
> 
> > So I wonder, is the workaround described in the book supported?
> 
> Well, I don't know about supported, but it clearly doesn't work.  Let's
> find out why and get it fixed, or changed.  That is, in Sugar or the
> book.  Books are code too, but they are slightly harder to change.
> 
> --
> James Cameron
> http://quozl.linux.org.au/
> _______________________________________________
> Sugar-devel mailing list
> Sugar-devel at lists.sugarlabs.org
> http://lists.sugarlabs.org/listinfo/sugar-devel
> 
> _______________________________________________
> Sugar-devel mailing list
> Sugar-devel at lists.sugarlabs.org
> http://lists.sugarlabs.org/listinfo/sugar-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sugarlabs.org/archive/sugar-devel/attachments/20110805/6800997c/attachment.html>


More information about the Sugar-devel mailing list