# Polymorphic get/set properties?

**URL:** <https://community.cesium.com/t/polymorphic-get-set-properties/1095>\
**Category:** CesiumJS\
**Created:** [March 25, 2014, 6:27pm UTC](https://community.cesium.com/t/polymorphic-get-set-properties/1095 "2014-03-25T18:27:07Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![patrick](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/patrick/32/2045_2.png) [@patrick](https://community.cesium.com/u/patrick)\
**Post date:** [March 25, 2014, 6:27pm UTC](https://community.cesium.com/t/polymorphic-get-set-properties/1095/1 "2014-03-25T18:27:07Z")

</div>

Now that JavaScript property access is fast, we have been [replacing get/set functions with properties](https://groups.google.com/forum/#!topic/cesium-dev/JAXyhmSTLTs) for [#1421](https://github.com/AnalyticalGraphicsInc/cesium/issues/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

---

<div class="post-metadata">

**Author:** ![Scott\_Hunter](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/scott_hunter/32/2006_2.png) [@Scott\_Hunter](https://community.cesium.com/u/Scott_Hunter)\
**Post date:** [March 25, 2014, 6:32pm UTC](https://community.cesium.com/t/polymorphic-get-set-properties/1095/2 "2014-03-25T18:32:51Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Matt\_Amato](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/matt_amato/32/1993_2.png) [@Matt\_Amato](https://community.cesium.com/u/Matt_Amato)\
**Post date:** [March 25, 2014, 6:33pm UTC](https://community.cesium.com/t/polymorphic-get-set-properties/1095/3 "2014-03-25T18:33:59Z")

</div>

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).

---

<div class="post-metadata">

**Author:** ![patrick](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/patrick/32/2045_2.png) [@patrick](https://community.cesium.com/u/patrick)\
**Post date:** [March 25, 2014, 6:43pm UTC](https://community.cesium.com/t/polymorphic-get-set-properties/1095/4 "2014-03-25T18:43:32Z")

</div>

Agreed. Thanks.
