{"action":"created","issue":{"url":"https://api.github.com/repos/phetsims/hookes-law/issues/9","labels_url":"https://api.github.com/repos/phetsims/hookes-law/issues/9/labels{/name}","comments_url":"https://api.github.com/repos/phetsims/hookes-law/issues/9/comments","events_url":"https://api.github.com/repos/phetsims/hookes-law/issues/9/events","html_url":"https://github.com/phetsims/hookes-law/issues/9","id":93352663,"number":9,"title":"createPropertySet() pattern in ParametricSpringNode","user":{"login":"jessegreenberg","id":6396244,"avatar_url":"https://avatars.githubusercontent.com/u/6396244?v=3","gravatar_id":"","url":"https://api.github.com/users/jessegreenberg","html_url":"https://github.com/jessegreenberg","followers_url":"https://api.github.com/users/jessegreenberg/followers","following_url":"https://api.github.com/users/jessegreenberg/following{/other_user}","gists_url":"https://api.github.com/users/jessegreenberg/gists{/gist_id}","starred_url":"https://api.github.com/users/jessegreenberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jessegreenberg/subscriptions","organizations_url":"https://api.github.com/users/jessegreenberg/orgs","repos_url":"https://api.github.com/users/jessegreenberg/repos","events_url":"https://api.github.com/users/jessegreenberg/events{/privacy}","received_events_url":"https://api.github.com/users/jessegreenberg/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/phetsims/hookes-law/labels/code%20review","name":"code review","color":"bfe5bf"}],"state":"open","locked":false,"assignee":{"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},"milestone":null,"comments":1,"created_at":"2015-07-06T19:05:05Z","updated_at":"2015-07-06T19:26:28Z","closed_at":null,"body":"createPropertySet is used as a static function to initialize all properties for the ParametricSpringNode.  This pattern is not used in any other scenery-phet object and requires the user to call\r\n```\r\nParametricSpringNode.createPropertySet( options ) \r\n```\r\n every time a ParametricSpringNode is instantiated.  Why is createPropertySet() used instead of passing properties into the main ParametricSpringNode constructor in an options block?"},"comment":{"url":"https://api.github.com/repos/phetsims/hookes-law/issues/comments/118970168","html_url":"https://github.com/phetsims/hookes-law/issues/9#issuecomment-118970168","issue_url":"https://api.github.com/repos/phetsims/hookes-law/issues/9","id":118970168,"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},"created_at":"2015-07-06T19:26:28Z","updated_at":"2015-07-06T19:26:28Z","body":"This pattern is bit of an experiment, trying to address a situation that we run into frequently in common code.\r\n\r\nParametricSpringNode is generalized for migration to scenery-phet, and will be used in other sims. It has many Properties.  Sims may want to set the default values of many of these Properties, but may only want to observe a few of them (i.e., only a few things are dynamic).  For example, hookes-law configures 7 of the 8 options, only observers 3 of them dynamically.\r\n\r\nThis pattern was chosen at after discussions with other developers (most recently @jonathanolson.) It allows you to specify default values for the Properties without having to create Properties. For example, hookes-law sets the 'loops' property (number of loops in the coil), but its not something that ever changes, so creating a Property is an odd requirement.  Other alternatives that were discussed were: requiring the client to create Properties for options of interest; overloading options to take either a default value or property. \r\n\r\nI'll assign this to @jbphet for his opinion, since he may have a fresh perspective."}}