I am currently migrating a large backbone application over to Marionette and am curious as to the opinions on what is a better design for mediating activity between modules.
I have an Application that have several Modules where an action in one module might cause activity to happen in other modules.
Since these all are coupled to the Application I could simply use the Wreqr interface where:
Module 1:
someActivity: ->
App.vent.trigger("skyFalling")
Module 2:
initialize: ->
App.vent.on("skyFalling", @closeOrSomething)
Module 3:
initialize: ->
App.vent.on("skyFalling", @blinkRapidly)
Or would it be better to trigger an event in Module1 where the Application (or a controller tied to the App) listens and then calls the 'closeOrSomething' and the 'blinkRapidly' functions directly on the modules (since the App is aware of all the modules that it is loading).
Application:
skyFallingEventHandler: ->
Module2.closeOrSomething()
Module3.blinkRapidly()