This is an interesting article. IMO every module should be able to tell the 
world what's happening on it with an event.

For example:

When an appWindow is opened, there is lots of actions to do. We dispatch 
'appopened' event here. I don't think it's maintainable if we remove all 
appopened event listeners in the system app and let appWindow to request 100 
different services when it got opened. It means appWindow should know too much 
details about other modules in the system app.

However, I agree that we should be more semantic if we are sure the actions are 
1 on 1 mapping instead of 1 on many.

Etienne Segonzac於 2015年11月19日星期四 UTC+8下午5時58分17秒寫道:
> So I'd suggest adding a Service.requestIfAvailable() or similar 
> (Service.ask() ?) to prevent this.
> I have a feeling the "semantic event" approach would degenerate quickly :)
> 
> 
> Thank you for caring!

r+

Thank you all for raising the topic and makes service.js better :)
_______________________________________________
dev-fxos mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-fxos

Reply via email to