{"action":"created","issue":{"url":"https://api.github.com/repos/phetsims/gravity-and-orbits/issues/191","labels_url":"https://api.github.com/repos/phetsims/gravity-and-orbits/issues/191/labels{/name}","comments_url":"https://api.github.com/repos/phetsims/gravity-and-orbits/issues/191/comments","events_url":"https://api.github.com/repos/phetsims/gravity-and-orbits/issues/191/events","html_url":"https://github.com/phetsims/gravity-and-orbits/issues/191","id":115940502,"number":191,"title":"reduce coupling to GravityAndOrbitsModule","user":{"login":"pixelzoom","id":3046552,"avatar_url":"https://avatars.githubusercontent.com/u/3046552?v=3","gravatar_id":"","url":"https://api.github.com/users/pixelzoom","html_url":"https://github.com/pixelzoom","followers_url":"https://api.github.com/users/pixelzoom/followers","following_url":"https://api.github.com/users/pixelzoom/following{/other_user}","gists_url":"https://api.github.com/users/pixelzoom/gists{/gist_id}","starred_url":"https://api.github.com/users/pixelzoom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pixelzoom/subscriptions","organizations_url":"https://api.github.com/users/pixelzoom/orgs","repos_url":"https://api.github.com/users/pixelzoom/repos","events_url":"https://api.github.com/users/pixelzoom/events{/privacy}","received_events_url":"https://api.github.com/users/pixelzoom/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/phetsims/gravity-and-orbits/labels/code%20review","name":"code review","color":"c7def8"}],"state":"open","locked":false,"assignee":{"login":"aaronsamuel137","id":3193912,"avatar_url":"https://avatars.githubusercontent.com/u/3193912?v=3","gravatar_id":"","url":"https://api.github.com/users/aaronsamuel137","html_url":"https://github.com/aaronsamuel137","followers_url":"https://api.github.com/users/aaronsamuel137/followers","following_url":"https://api.github.com/users/aaronsamuel137/following{/other_user}","gists_url":"https://api.github.com/users/aaronsamuel137/gists{/gist_id}","starred_url":"https://api.github.com/users/aaronsamuel137/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aaronsamuel137/subscriptions","organizations_url":"https://api.github.com/users/aaronsamuel137/orgs","repos_url":"https://api.github.com/users/aaronsamuel137/repos","events_url":"https://api.github.com/users/aaronsamuel137/events{/privacy}","received_events_url":"https://api.github.com/users/aaronsamuel137/received_events","type":"User","site_admin":false},"milestone":null,"comments":2,"created_at":"2015-11-09T18:53:09Z","updated_at":"2015-11-11T17:58:56Z","closed_at":null,"body":"Related to code review #173.\r\n\r\nGravityModeMenu is the control for turning gravity on/off.  Here are the relevant pieces of its constructor:\r\n\r\n```js\r\nfunction GravityModeMenu( module, options ) {\r\n...\r\n  new AquaRadioButton( module.gravityEnabledProperty, true, onTextNode, RADIO_OPTIONS ),\r\n  new AquaRadioButton( module.gravityEnabledProperty, false, offTextNode, RADIO_OPTIONS )\r\n...\r\n  }\r\n```\r\n\r\nBy passing `module` into the constructor, unnecessary coupling between `GravityAndOrbitsModule` and `GravityModeMenu` is created. Increasing coupling (in general) increases the probability of bugs and increases maintenance costs. Eliminate this coupling by passing in only what is needed by GravityModeMenu; that is, `gravityEnabledProperty`.  I.e.:\r\n\r\n```js\r\nfunction GravityModeMenu( gravityEnabledProperty, options ) {\r\n...\r\n  new AquaRadioButton( gravityEnabledProperty, true, onTextNode, RADIO_OPTIONS ),\r\n  new AquaRadioButton( gravityEnabledProperty, false, offTextNode, RADIO_OPTIONS )\r\n...\r\n  }\r\n```"},"comment":{"url":"https://api.github.com/repos/phetsims/gravity-and-orbits/issues/comments/155861843","html_url":"https://github.com/phetsims/gravity-and-orbits/issues/191#issuecomment-155861843","issue_url":"https://api.github.com/repos/phetsims/gravity-and-orbits/issues/191","id":155861843,"user":{"login":"aaronsamuel137","id":3193912,"avatar_url":"https://avatars.githubusercontent.com/u/3193912?v=3","gravatar_id":"","url":"https://api.github.com/users/aaronsamuel137","html_url":"https://github.com/aaronsamuel137","followers_url":"https://api.github.com/users/aaronsamuel137/followers","following_url":"https://api.github.com/users/aaronsamuel137/following{/other_user}","gists_url":"https://api.github.com/users/aaronsamuel137/gists{/gist_id}","starred_url":"https://api.github.com/users/aaronsamuel137/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aaronsamuel137/subscriptions","organizations_url":"https://api.github.com/users/aaronsamuel137/orgs","repos_url":"https://api.github.com/users/aaronsamuel137/repos","events_url":"https://api.github.com/users/aaronsamuel137/events{/privacy}","received_events_url":"https://api.github.com/users/aaronsamuel137/received_events","type":"User","site_admin":false},"created_at":"2015-11-11T17:58:56Z","updated_at":"2015-11-11T17:58:56Z","body":"I've addressed this issue for all the mentioned files except SpaceObjectsPropertyCheckbox. It seems like this file uses 7 or 8 attributes of module, so passing the whole module seems justifiable to me. What do you think?\r\n\r\nAssigning to @pixelzoom for review."}}