AnalyticalGraphicsInc/cesium — pull request #750 by mramato (2013-05-07 20:44:32+00:00)
Title: Data source abstraction

I don't expect this to be merged anytime soon (I still need to write specs). I'm opening this pull request to get some initial feedback. @shunter @emackey and @kring would probably be the most interested. In the past I would have made a much bigger pull request, but I'm trying to start doing more incremental changes.

Something I did poorly in the current implementation of the DynamicScene layer is fail to abstract away things that process data (CZML/KML/GeoJSON) from things that represent the data (DynamicObject etc...) and things that visualize the data (i.e. Visualizers). This is a very early start into rectifying that mistake.

The idea here is that there is a "base interface" DataSource which has concrete implementations for each format we support (currently just CZML). Basically DataSources turn data into an DynamicObjectCollection which from that point on can be treated generically by anyone who cares. I then introduce a DataSourceDisplay which can visualize the various DataSources, each into it's own "scope". This allows you to non-destructively add/remove data sources with ease. This will eventually be needed for our to-be-coded TableOfContents widget.

You'll note that nothing is actually using this yet. I'm doing that work in the `viewer` branch which has a new non-Dojo version of CesiumViewerWidget. I wanted to keep that work separate.

Assuming you guys don't have any issues with the direction I'm taking, I think my next step would be to move all of the CZML specific processing code into CzmlDataSource. I would then start refactoring DynamicProperty and related instances to make it easier to programmatically add data into the system.

All of this will make it easier for our summer of code developers to implement the new data sources we hope to support.