{"action":"created","issue":{"url":"https://api.github.com/repos/phetsims/axon/issues/67","labels_url":"https://api.github.com/repos/phetsims/axon/issues/67/labels{/name}","comments_url":"https://api.github.com/repos/phetsims/axon/issues/67/comments","events_url":"https://api.github.com/repos/phetsims/axon/issues/67/events","html_url":"https://github.com/phetsims/axon/issues/67","id":104323303,"number":67,"title":"questionable functions for poking a Property's stored and initial value","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":[],"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":8,"created_at":"2015-09-01T18:07:42Z","updated_at":"2015-09-23T17:05:51Z","closed_at":null,"body":"axon.Property has these public functions:\r\n\r\n```js\r\n      // @public store the current (new) value\r\n      storeValue: function( value ) {\r\n        this._value = value;\r\n      },\r\n\r\n      // @public store the initial value\r\n      storeInitialValue: function( value ) {\r\n        this._initialValue = value;\r\n      },\r\n```\r\n\r\nBoth of these look dubious. Setting the value without notification, and changing the initial value. These are used in a handful of sims: fluid-pressure-and-flow, pendulum-lab, seasons, under-pressure. I'm especially leary of this in non-PhET code.\r\n\r\nIn the case of storeValue... It looks like this is used for setting a value without triggering notification. That seems like a generally bad idea, probably a workaround that involves another workaround to force a notification later.\r\n\r\nIn the case of storeInitialValue... Most (all?) look like lazy workarounds, where it would be better to design things so that the Property could be initialized with the proper value.  \r\n\r\nOr perhaps I'm missing something... Assigning to @samreid  to comment on the use case where these are necessary, since it looks like he's the main user (other than MLL)."},"comment":{"url":"https://api.github.com/repos/phetsims/axon/issues/comments/142664787","html_url":"https://github.com/phetsims/axon/issues/67#issuecomment-142664787","issue_url":"https://api.github.com/repos/phetsims/axon/issues/67","id":142664787,"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-09-23T17:05:51Z","updated_at":"2015-09-23T17:05:51Z","body":"> Look at the change sets: 1591786 and 537bd37 and think about whether they will have unintended consequences\r\n\r\nI have no idea if removing storeValue and storeInitialValue will unintended consequences. I've never used them. And it looks like you've removed all call sites, so any consequences will probably be identifiable during testing.\r\n\r\n> what do you think about sims that create the model at some coordinates, then create the view item (with position based on mvt(model)), then adjusts the position of the view item, then the user presses reset. How to handle getting it to go back to the correct view position, and not the original model location?\r\n\r\nSounds like a sim design problem to me.  Assuming that the location (coordinates) need to be in the model, then I don't see why the model shouldn't be initialized to the proper default value when it's instantiated.  And if the location is view-specific, then it shouldn't be in the model to begin with.\r\n\r\n"}}