{"action":"created","issue":{"url":"https://api.github.com/repos/lhorie/mithril.js/issues/499","labels_url":"https://api.github.com/repos/lhorie/mithril.js/issues/499/labels{/name}","comments_url":"https://api.github.com/repos/lhorie/mithril.js/issues/499/comments","events_url":"https://api.github.com/repos/lhorie/mithril.js/issues/499/events","html_url":"https://github.com/lhorie/mithril.js/issues/499","id":62792059,"number":499,"title":"Rename \"controller\"","user":{"login":"mindeavor","id":17013,"avatar_url":"https://avatars.githubusercontent.com/u/17013?v=3","gravatar_id":"","url":"https://api.github.com/users/mindeavor","html_url":"https://github.com/mindeavor","followers_url":"https://api.github.com/users/mindeavor/followers","following_url":"https://api.github.com/users/mindeavor/following{/other_user}","gists_url":"https://api.github.com/users/mindeavor/gists{/gist_id}","starred_url":"https://api.github.com/users/mindeavor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mindeavor/subscriptions","organizations_url":"https://api.github.com/users/mindeavor/orgs","repos_url":"https://api.github.com/users/mindeavor/repos","events_url":"https://api.github.com/users/mindeavor/events{/privacy}","received_events_url":"https://api.github.com/users/mindeavor/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":51,"created_at":"2015-03-18T20:30:54Z","updated_at":"2015-03-22T17:26:59Z","closed_at":null,"body":"> My thinking is that \"controller\" is not sufficiently agnostic; the word comes with MVC baggage, yet it's use is very flexible\r\n> [source](https://github.com/lhorie/mithril.js/issues/413#issuecomment-83119984)\r\n\r\n>  It's not that the view context can't serve as a controller, nor that it shouldn't if you choose to use MVC, but that it shouldn't be inferred to be limited to that concept by it's name.\r\n> [source](https://github.com/lhorie/mithril.js/issues/413#issuecomment-83132957)\r\n\r\nSuggestions: scope, context, viewContext, viewctx, state, viewstate\r\n\r\nCounter arguments:\r\n\r\n> While a controller can do many other things I think the MVC \"baggage\" is useful as it's a shared term with an understood meaning that gets the point across. Just because you can use it in other ways doesn't negate the fact that calling it a controller identifies the basic utility of it in a quick way that doesn't force you to learn a new term\r\n> [source](https://github.com/lhorie/mithril.js/issues/413#issuecomment-83122744)\r\n\r\n> Why the word \"controller\" is wrong?\r\n> \"Controllers contain the interface between their associated models and views and the input devices\r\n(keyboard, pointing device, time). Controllers also deal with scheduling interactions with other\r\nview-controller pairs: they track mouse movement between application views, and implement\r\nmessages for mouse button activity and input from the input sensor. Although menus can be\r\nthought of as view-controller pairs, they are more typically considered input devices, and\r\ntherefore are in the realm of controllers.\"\r\n> This is what the controller of mithril is doing right now. Mithril is one of the few frameworks that i really believe is using the MVC pattern correctly.\r\n> [source](https://github.com/lhorie/mithril.js/issues/413#issuecomment-82697803)"},"comment":{"url":"https://api.github.com/repos/lhorie/mithril.js/issues/comments/84659589","html_url":"https://github.com/lhorie/mithril.js/issues/499#issuecomment-84659589","issue_url":"https://api.github.com/repos/lhorie/mithril.js/issues/499","id":84659589,"user":{"login":"mindeavor","id":17013,"avatar_url":"https://avatars.githubusercontent.com/u/17013?v=3","gravatar_id":"","url":"https://api.github.com/users/mindeavor","html_url":"https://github.com/mindeavor","followers_url":"https://api.github.com/users/mindeavor/followers","following_url":"https://api.github.com/users/mindeavor/following{/other_user}","gists_url":"https://api.github.com/users/mindeavor/gists{/gist_id}","starred_url":"https://api.github.com/users/mindeavor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mindeavor/subscriptions","organizations_url":"https://api.github.com/users/mindeavor/orgs","repos_url":"https://api.github.com/users/mindeavor/repos","events_url":"https://api.github.com/users/mindeavor/events{/privacy}","received_events_url":"https://api.github.com/users/mindeavor/received_events","type":"User","site_admin":false},"created_at":"2015-03-22T17:26:59Z","updated_at":"2015-03-22T17:26:59Z","body":"Thank you @ciscoheat for this writeup, it was very informative. I enjoy reading the research and history of software terminology.\r\n\r\nJust yesterday I finished teaching my students a design patterns lesson on MVP vs MVC in JavaScript. I demonstrated how to accomplish both using plain jQuery. In my code examples, the view was constructed with jQuery, and the controller was a set of static functions (the model was what anyone would expect a model to be). When it came time to introduce data-binding, I introduced the concept of a view-model, and modified the view to bind data to it. My reasoning was that the view-model held all transient, view-related state, while the controller was meant to house actions for the view to take.\r\n\r\nYour phrase \"separation of concerns at any cost\" struck me to reevaluate my decision to separate the controller and the view-model. Are these two concepts really that distinct? Is there any real advantage in separating them?\r\n\r\nI could not think of a good reason for the separation. I will admit, I have always separated view state from the controller only for the sake of \"good software design practice\", and never consciously considered the tangible benefits.\r\n\r\nIf we can all agree that **it's actually ok for a controller to hold view-related state,** and in turn have this evidence and reasoning in documentation, then the name `controller` for Mithril stands perfectly clear. We can then resolve and put this GitHub issue to rest."}}