Polymorphic get/set properties?

Now that JavaScript property access is fast, we have been replacing get/set functions with properties for #1421 to help stabilize the Cesium API.

Sometimes we have get functions defined in a base class and then implemented in a derived class. Do we want to replace these with properties? I assume yes because, for example, C# has virtual properties. Does this also make sense in JavaScript?

Specifically, I’m talking about the following types:

Scene

  • TerrainData and derived types
  • Appearance and derived types

DynamicScene

  • DataSource and derived types

  • All Visualizer types

Thanks,

Patrick

Just to clarify, TerrainData, Appearance, DataSource, etc. are all “interfaces”, not “base classes”. Cesium has no derived classes, or inheritance.

I see no reason to treat these specially. We already use properties in interfaces throughout the DynamicScene layer, see Property, for example.

Scott beat me to it, but “what he said”. A larger refactoring of DataSource and Visualizers are already on the near-term roadmap and the properties changes will be made as part of that effort (to avoid churn by changing things twice).

Agreed. Thanks.