phetsims / axon

Axon provides powerful and concise models for interactive simulations, based on observable Properties and related patterns.
MIT License
10 stars 8 forks source link

PropertyIO is declared in ReadOnlyProperty #429

Open samreid opened 1 year ago

samreid commented 1 year ago

As @pixelzoom described in https://github.com/phetsims/tandem/issues/285#issuecomment-1336191339

(1) PropertyIO is not defined in Property.ts, and is in fact associated with core type ReadOnlyProperty. So it violates the PhET naming conventions, and was therefore confusing. If conventions had been followed, I should have been looking at replacements of Property.PropertyIO with PropertyIO.

At the moment PhET-iO does not distinguish between PropertyIO and ReadOnlyPropertyIO. Instead, everything is PropertyIO and non-settable ones are identified via phetioReadOnly: true. I do not know whether this is the clearest, best strategy, but just wanted to write down how it works at the moment. How can we decide whether we need to create ReadOnlyPropertyIO and reveal it to clients?