{"action":"created","issue":{"url":"https://api.github.com/repos/CodeAdventure/space-ui/issues/16","labels_url":"https://api.github.com/repos/CodeAdventure/space-ui/issues/16/labels{/name}","comments_url":"https://api.github.com/repos/CodeAdventure/space-ui/issues/16/comments","events_url":"https://api.github.com/repos/CodeAdventure/space-ui/issues/16/events","html_url":"https://github.com/CodeAdventure/space-ui/issues/16","id":57565967,"number":16,"title":"Mediator vs. Controller","user":{"login":"DerMambo","id":1655310,"avatar_url":"https://avatars.githubusercontent.com/u/1655310?v=3","gravatar_id":"","url":"https://api.github.com/users/DerMambo","html_url":"https://github.com/DerMambo","followers_url":"https://api.github.com/users/DerMambo/followers","following_url":"https://api.github.com/users/DerMambo/following{/other_user}","gists_url":"https://api.github.com/users/DerMambo/gists{/gist_id}","starred_url":"https://api.github.com/users/DerMambo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DerMambo/subscriptions","organizations_url":"https://api.github.com/users/DerMambo/orgs","repos_url":"https://api.github.com/users/DerMambo/repos","events_url":"https://api.github.com/users/DerMambo/events{/privacy}","received_events_url":"https://api.github.com/users/DerMambo/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-02-13T06:49:32Z","updated_at":"2015-02-15T22:01:22Z","closed_at":null,"body":"Hi @DominikGuzei,\r\n\r\nafter using space-ui and getting into it I really like it and am willing to use it, great job so far!\r\n\r\nOne thing I am looking at right now is the Mediator and I have some suggestions/questions/discussing points for that.\r\n\r\nWhy not use one single Mediator for the whole app that is only for the communication between different parts of the application. You might want to look at ChaplinJS which has a very good implementation of the mediator pattern (http://chaplinjs.org/) and modular application design in general.\r\n\r\nThis way you could take the responsibility for e.g. helpers out of the mediator but put it into controllers or introduce a new component class that is responsible for the orchestration of templates. Maybe one could also use the iron-router controller which provides this kind of functionality?!\r\n\r\nKeep up the good work!\r\nManuel"},"comment":{"url":"https://api.github.com/repos/CodeAdventure/space-ui/issues/comments/74439611","html_url":"https://github.com/CodeAdventure/space-ui/issues/16#issuecomment-74439611","issue_url":"https://api.github.com/repos/CodeAdventure/space-ui/issues/16","id":74439611,"user":{"login":"DominikGuzei","id":172414,"avatar_url":"https://avatars.githubusercontent.com/u/172414?v=3","gravatar_id":"","url":"https://api.github.com/users/DominikGuzei","html_url":"https://github.com/DominikGuzei","followers_url":"https://api.github.com/users/DominikGuzei/followers","following_url":"https://api.github.com/users/DominikGuzei/following{/other_user}","gists_url":"https://api.github.com/users/DominikGuzei/gists{/gist_id}","starred_url":"https://api.github.com/users/DominikGuzei/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DominikGuzei/subscriptions","organizations_url":"https://api.github.com/users/DominikGuzei/orgs","repos_url":"https://api.github.com/users/DominikGuzei/repos","events_url":"https://api.github.com/users/DominikGuzei/events{/privacy}","received_events_url":"https://api.github.com/users/DominikGuzei/received_events","type":"User","site_admin":false},"created_at":"2015-02-15T22:01:22Z","updated_at":"2015-02-15T22:01:22Z","body":"To clarify your confusion about `@actions`:\r\nThere is exactly one `Dispatcher` for your whole application which works like a simple event bus. So you could get a reference to that anywhere by declaring `dispatcher: 'Space.ui.Dispatcher'` as a dependency. Then you can broadcast an action by calling `@dispatcher.dispatch` with a plain object. There is no filtering system or anything, it just gets broadcasted to any listener in your app – They can decide if they are interested in the action by looking on the payload object. The reason for this is simple: There are not many listeners, most commonly there are only a few stores that react to actions. All other parts of you application (e.g. `mediators` / `views`) are updated \"magically\" via the Meteor reactive `Tracker`. So your mediators / views dont need to listen to these actions (and they shouldn't have to)."}}