deck.gl icon indicating copy to clipboard operation
deck.gl copied to clipboard

Class name cleanup

Open howtimeflies0 opened this issue 9 years ago • 6 comments

Clean up names in deck.gl so that file names / class names / export, import names are consistent.

howtimeflies0 avatar Oct 05 '17 23:10 howtimeflies0

We are generally pretty consistent. Any particular files that stick out as needing attention?

ibgreen avatar Oct 06 '17 00:10 ibgreen

For example, in src/core/controllers/, we are actually defining various Controls classes, MapState and OrbitState classes. We need to rename either the folder or the classes

The class defined in ViewportController.js is Controller

howtimeflies0 avatar Oct 06 '17 17:10 howtimeflies0

Yes, I see what you mean.

  • From a previous discussion, since controls refers to things like buttons etc, we wanted to avoid that word and call these something else (like controllers).
  • And since the naming was still up in the air and changing, it was hard to be rigorous.

My RFC contains one attempt to settle on names, something like:

  • ViewState (collects all position fields from MapState, OrbitState, FirstPersonState).
  • Controller -> base class for MapController, ThirdPersonController, FirstPersonController (collects all ViewState update logic from MapState, OrbitState, FirstPersonState). They all generate a stream of ViewStates.
  • Viewport -> base class for MapViewport, ThirdPersonViewport, FirstPersonViewport - they all consume ViewStates and display them in different ways.

The master component could either be DeckGL or a ViewStateController.

ibgreen avatar Oct 06 '17 18:10 ibgreen

@ibgreen Can we also rename the Controls class to something else? Controls vs. Controller is extremely confusing even in our internal discussions.

Pessimistress avatar Oct 06 '17 19:10 Pessimistress

Can we also rename the Controls class to something else? Controls vs. Controller is extremely confusing even in our internal discussions.

Yes absolutely, per comments above.

ibgreen avatar Oct 06 '17 20:10 ibgreen

#990

jianhuang01 avatar Oct 06 '17 20:10 jianhuang01