phetsims/build-an-atom

directories and top-level classes do not follow PhET naming conventions

Closed this issue · 1 comments

Noted while working on phetsims/tasks#1052.

build-an-atom violates several PhET naming conventions. This made it unnecessarily difficult to find things while doing the above review.

Violations and suggested changes:

(1) js/ subdirectories are named based on screens. "Atom" screen should be in js/atom/, not js/build-an-atom.

(2) ScreenView subclass names have "ScreenView" suffix. Violated by AtomView, BuildAnAtomView, and SymbolView. BAAGameScreenView is the only ScreenView subclass that follows the convention.

(3) Naming of Screen, ScreenView, and Model subclasses is mostly not following PhET conventions. SymbolScreen and GameScreen follow PhET conventions, others do not. Rename these to follow PhET conventions:

  • AtomView -> BAAScreenView, the base class for ScreenViews in build-an-atom
  • BuildAnAtomScreen -> AtomScreen, the Screen for the "Atom" screen
  • BuildAnAtomView -> AtomScreenView, the ScreenView for the "Atom" screen
  • BuildAnAtomModel -> AtomModel, the model for the "Atom" screen, and move to js/atom/model/
  • SymbolView -> SymbolScreenView, the ScreenView for the "Symbol" screen
  • BAAGameScreenView -> GameScreenView, the ScreenView for the "Game" screen
  • BAAGameModel -> GameModel, the model for the "Game" screen

A lot of this stems from the name of the first screen having been changed from "Build an Atom" to simply "Atom" a while back. I guess I never updated all the type names when that happened.

I've implemented all of the suggestions except this one:

BuildAnAtomModel -> AtomModel, the model for the "Atom" screen, and move to js/atom/model/

BuildAnAtomModel is actually used by the first two screens, which is why it's in the common directory. I updated the header comment to reflect this and left the name as is. Hopefully this will help to avoid confusion in the future.

@pixelzoom - I'm going to go ahead and close this and assume that you don't feel the need to review, but you're welcome to if you're so inclined.