{"action":"created","issue":{"url":"https://api.github.com/repos/phetsims/together/issues/28","labels_url":"https://api.github.com/repos/phetsims/together/issues/28/labels{/name}","comments_url":"https://api.github.com/repos/phetsims/together/issues/28/comments","events_url":"https://api.github.com/repos/phetsims/together/issues/28/events","html_url":"https://github.com/phetsims/together/issues/28","id":64528488,"number":28,"title":"How to instrument very similar modules?","user":{"login":"samreid","id":679486,"avatar_url":"https://avatars.githubusercontent.com/u/679486?v=3","gravatar_id":"","url":"https://api.github.com/users/samreid","html_url":"https://github.com/samreid","followers_url":"https://api.github.com/users/samreid/followers","following_url":"https://api.github.com/users/samreid/following{/other_user}","gists_url":"https://api.github.com/users/samreid/gists{/gist_id}","starred_url":"https://api.github.com/users/samreid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samreid/subscriptions","organizations_url":"https://api.github.com/users/samreid/orgs","repos_url":"https://api.github.com/users/samreid/repos","events_url":"https://api.github.com/users/samreid/events{/privacy}","received_events_url":"https://api.github.com/users/samreid/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-03-26T13:37:28Z","updated_at":"2015-03-26T15:18:03Z","closed_at":null,"body":"I wanted to try to instrument EnergySkatePark:Basics so I could investigate how to instrument very similar screens (though the same issues will apply to other kinds of similar modules as well).\r\n\r\nI first tried a \"brute force\" approach, hardcoding  componentID declarations and pushing them back as far as necessary to reach all of the components: 61513e622b03219f4aa83b642341ca6d8ff0006d\r\n\r\nThis solutions has the benefit that componentID strings always appear as whole strings and are hence easily searchable, but there is a lot of boilerplate and duplication which could lead to errors.\r\n\r\nPerhaps we should experiment with a more dynamic approach, such as passing the screen name through and using that to concatenate componentIDs.  This could save on having to pass explicit componentIDs through everywhere at the cost of making it more difficult to search/find the componentIDs in the code.\r\n\r\nAnother possibility that crossed my mind was to pass the screen componentID map through to every component (unmodified) and let each component draw its componentID from that map.  That would be somewhat similar to passing through the screen name for concatenation, but may expose too much information (TMI) to all components."},"comment":{"url":"https://api.github.com/repos/phetsims/together/issues/comments/86564497","html_url":"https://github.com/phetsims/together/issues/28#issuecomment-86564497","issue_url":"https://api.github.com/repos/phetsims/together/issues/28","id":86564497,"user":{"login":"samreid","id":679486,"avatar_url":"https://avatars.githubusercontent.com/u/679486?v=3","gravatar_id":"","url":"https://api.github.com/users/samreid","html_url":"https://github.com/samreid","followers_url":"https://api.github.com/users/samreid/followers","following_url":"https://api.github.com/users/samreid/following{/other_user}","gists_url":"https://api.github.com/users/samreid/gists{/gist_id}","starred_url":"https://api.github.com/users/samreid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samreid/subscriptions","organizations_url":"https://api.github.com/users/samreid/orgs","repos_url":"https://api.github.com/users/samreid/repos","events_url":"https://api.github.com/users/samreid/events{/privacy}","received_events_url":"https://api.github.com/users/samreid/received_events","type":"User","site_admin":false},"created_at":"2015-03-26T15:18:03Z","updated_at":"2015-03-26T15:18:03Z","body":"The above commit \"Moved gridCheckBox to ComponentIDContext...\" is a good example of the tradeoff between the brute force and dynamic (context-based) approaches.  Seems like a good direction to move in--the brute force approach requires too much manual labor and has too many opportunities for typos."}}