[Sugar-devel] M-V-C model for MusicBlocks

Bottersnike bottersnike237 at gmail.com
Wed Mar 11 11:59:49 EDT 2020


It is worth noting that the module loading method MusicBlocks uses,
requirejs, is particularly susceptible to race conditions. From testing, at
the moment is it currently just at the limit of the number of files it's
able to load without this being an issue, however I suspect if each widget
requires two files not one, along with the additional shared boilerplate
code that'll be needed, this may tip requirejs over the edge. This should
be avoidable by making use of define(), however it'll be something to keep
in mind if strange race conditions start to appear on page load (especially
a fresh load without cache).

On Wed, 11 Mar 2020, 15:52 b18050 b18050, <b18050 at students.iitmandi.ac.in>
wrote:

> This is very helpful for beginner developers also if we maintain
> individual directories for every widget. Different widgets work
> differently. So, there must be some differences in them i.e. a change in
> one of the widget can affect only that widget. If we want to add any
> facility to multiple widgets, it will be just a matter of adding
> implemented code to that widget , which can be done
> easily.
> Please provide any further suggestions .
>
> On Wed, Mar 11, 2020 at 9:03 PM Walter Bender <walter.bender at gmail.com>
> wrote:
>
>> Sounds good to me. We should probably make an individual directory for
>> each widget with its model and controller js files.
>>
>> On Wed, Mar 11, 2020 at 11:22 AM b18050 b18050 <
>> b18050 at students.iitmandi.ac.in> wrote:
>>
>>> Hello everyone,
>>> This is regarding model - view - controller model of Music Blocks. As
>>> suggested by respected mentor , there is a need to separate controller and
>>> model of widgets. I think it will be good if for every widget, we can have
>>> two files controller.js  and model.js. In model.js , we can store the data
>>> and the domain logic. In controller.js , various processes and response to
>>> various events and invokes changes on the model and the view.
>>>
>>>
>>>
>>
>> --
>> Walter Bender
>> Sugar Labs
>> http://www.sugarlabs.org
>> <http://www.sugarlabs.org>
>>
> _______________________________________________
> 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/20200311/ea6f3420/attachment.htm>


More information about the Sugar-devel mailing list