{"action":"created","issue":{"url":"https://api.github.com/repos/jadzeino/theNewOSMFplayer/issues/1","labels_url":"https://api.github.com/repos/jadzeino/theNewOSMFplayer/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/jadzeino/theNewOSMFplayer/issues/1/comments","events_url":"https://api.github.com/repos/jadzeino/theNewOSMFplayer/issues/1/events","html_url":"https://github.com/jadzeino/theNewOSMFplayer/issues/1","id":59193413,"number":1,"title":"MVC design","user":{"login":"hopewise","id":1061157,"avatar_url":"https://avatars.githubusercontent.com/u/1061157?v=3","gravatar_id":"","url":"https://api.github.com/users/hopewise","html_url":"https://github.com/hopewise","followers_url":"https://api.github.com/users/hopewise/followers","following_url":"https://api.github.com/users/hopewise/following{/other_user}","gists_url":"https://api.github.com/users/hopewise/gists{/gist_id}","starred_url":"https://api.github.com/users/hopewise/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hopewise/subscriptions","organizations_url":"https://api.github.com/users/hopewise/orgs","repos_url":"https://api.github.com/users/hopewise/repos","events_url":"https://api.github.com/users/hopewise/events{/privacy}","received_events_url":"https://api.github.com/users/hopewise/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-02-27T05:43:46Z","updated_at":"2015-02-27T13:39:47Z","closed_at":null,"body":"Salam Ahmad,\r\n\r\nThat's good:\r\nvar myPlayerModel:PlayerModel = new PlayerModel()\r\n\r\nThat's not good:\r\nvar myPlayerView:PlayerView = new PlayerView(myPlayerModel, myPlayerControl);\r\n\r\nView should not know about the model, and controller, view just emit events.\r\nThe controller will know about the current view by listening to its events.\r\n\r\nHow would the controller know about the viewer?\r\nYou should add something like that:\r\n\r\nmyPlayerControl.setView (myPlayerView);\r\n\r\nthe controller will expect an object that implements IPlayerView interface\r\n in the controller:\r\n\r\npublic function setView (aView: IPlayerView){\r\n// add event listeners to aView, you might need to cast it\r\n// assign current view property to aView\r\n}\r\n\r\nIn general, view should be able to handle all the logic that is related to its graphics, buttons, slider bars.. etc ..\r\n\r\nI advice you to read MVC at this book: http://shop.oreilly.com/product/9780596528461.do\r\n\r\nAnd if you like, there is a common concept, that is dependency injection, read here: https://www.google.com/webhp?sourceid=chrome-instant&ion=1&espv=2&es_th=1&ie=UTF-8#q=as3+dependency+injectio\r\n\r\n\r\n\r\nGood luck my brother, few people care about code quality, specially when you work with managers that has nothing to do with programming ..\r\n\r\nViews should be easily plugged, and unplugged into controller.. so they should be loosely coupled\r\n\r\nAnd last advice, move to haxe\r\n\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/jadzeino/theNewOSMFplayer/issues/comments/76395440","html_url":"https://github.com/jadzeino/theNewOSMFplayer/issues/1#issuecomment-76395440","issue_url":"https://api.github.com/repos/jadzeino/theNewOSMFplayer/issues/1","id":76395440,"user":{"login":"jadzeino","id":11145282,"avatar_url":"https://avatars.githubusercontent.com/u/11145282?v=3","gravatar_id":"","url":"https://api.github.com/users/jadzeino","html_url":"https://github.com/jadzeino","followers_url":"https://api.github.com/users/jadzeino/followers","following_url":"https://api.github.com/users/jadzeino/following{/other_user}","gists_url":"https://api.github.com/users/jadzeino/gists{/gist_id}","starred_url":"https://api.github.com/users/jadzeino/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jadzeino/subscriptions","organizations_url":"https://api.github.com/users/jadzeino/orgs","repos_url":"https://api.github.com/users/jadzeino/repos","events_url":"https://api.github.com/users/jadzeino/events{/privacy}","received_events_url":"https://api.github.com/users/jadzeino/received_events","type":"User","site_admin":false},"created_at":"2015-02-27T13:39:46Z","updated_at":"2015-02-27T13:39:46Z","body":"Dear Samir,\nThanks a lot my friend I really appreciate concerns\nYour such a good friend\nMay Allah spread his kindness over you\nAnd bless you and your family\n On 27 Feb 2015 08:43, \"Samir Sabri\" <notifications@github.com> wrote:\n\n> Salam Ahmad,\n>\n> That's good:\n> var myPlayerModel:PlayerModel = new PlayerModel()\n>\n> That's not good:\n> var myPlayerView:PlayerView = new PlayerView(myPlayerModel,\n> myPlayerControl);\n>\n> View should not know about the model, and controller, view just emit\n> events.\n> The controller will know about the current view by listening to its events.\n>\n> How would the controller know about the viewer?\n> You should add something like that:\n>\n> myPlayerControl.setView (myPlayerView);\n>\n> the controller will expect an object that implements IPlayerView interface\n> in the controller:\n>\n> public function setView (aView: IPlayerView){\n> // add event listeners to aView, you might need to cast it\n> // assign current view property to aView\n> }\n>\n> In general, view should be able to handle all the logic that is related to\n> its graphics, buttons, slider bars.. etc ..\n>\n> I advice you to read MVC at this book:\n> http://shop.oreilly.com/product/9780596528461.do\n>\n> And if you like, there is a common concept, that is dependency injection,\n> read here:\n> https://www.google.com/webhp?sourceid=chrome-instant&ion=1&espv=2&es_th=1&ie=UTF-8#q=as3+dependency+injectio\n>\n> Good luck my brother, few people care about code quality, specially when\n> you work with managers that has nothing to do with programming ..\n>\n> Views should be easily plugged, and unplugged into controller.. so they\n> should be loosely coupled\n>\n> And last advice, move to haxe\n>\n> —\n> Reply to this email directly or view it on GitHub\n> <https://github.com/jadzeino/theNewOSMFplayer/issues/1>.\n>\n"}}