Skip to content

Instantly share code, notes, and snippets.

@jhannes
Created March 18, 2012 18:45
Show Gist options
  • Save jhannes/2079597 to your computer and use it in GitHub Desktop.
Save jhannes/2079597 to your computer and use it in GitHub Desktop.
Mikado "tree" for "space" exercise 2
v Separate Solar system and bouncing ball logic
v Delete IS_BOUNCING_BALL flagg
v Move main method of Space to subclasses
v Create subclasses of "Space"
v Remove IS_BOUNCING_BALLS if-test in main
v Extract main method logic to non-static method
v Make IS_BOUNCING_BALLS into an argument
v Convert if statements into polymorphism
v Convert IS_BOUNCING_BALLS into non-static field in Space
v Move IS_BOUNCING_BALLS to Space
v Convert IS_BOUNCING_BALLS to parameter in PhysicalObject
v Remove dead code
v Replace IS_BOUNCING_BALLS with constants
v push down mouseWheelMoved
v extract and subclass call to paintPhysicalObject
v extract and push down call doStep
v push down collide (duplicate and delete)
v push down mouseDragged
v Remove isSolarSystem parameter from run()
v replace boolean parameter with polymorphism
v Extract and push down createPhysicalObjects
v Move weightToColor to Solar
v Remove isSolarSystem parameter from paintPhysicalObject
v Align branches in if-test
v Make Color into a parameter
v Make scale a parameter
v Make diameter a parameter
v Remove spurious fields in PhysicalObject
v Separate Domain Logic from Swing
v ADD setDefaultCloseOperation(EXIT_ON_CLOSE); !!!!!
v Cleanup
v BUG: Resize event
v Make scale, centerX and centerY non-static
v Move scale, centerX, centerY to Space
v Move EARTH_MASS to Solar
x Move dragging logic to space (?)
v Combine step and collide and step++
v move second to Space
v Remove Swing imports from PhysicalObject
v Remove JFrame from PhysicalObject
v Remove paint method from PhysicalObject
v Remove Swing imports from Space
v Remove JFrame superclass from Space
v Remove step() from Space
v use doStep instead of step in test
v Remove use of getSize and getWidth from Space and subclasses and Implement Space.setSize
v Move paint to SpaceFrame
v Remove animation from Space
v Remove main methods from Space subclasses
v Move buffered painting into SwingDisplay
v Move business logic for painting into Space
v Push down Listeners
v Extract add*Listener calls in run to subclasses
v Remove Swing imports from Bounce
v Move Swing logic in Space to SpaceFrame
v Create SpaceFrame
v Copy Space.run into SpaceFrame
v Move Bounce KeyListener to SpaceFrame
v Remove Graphics2D in doPaintObject
v Hide implementation of doPaintObject in Solar
v Hide implementation of doPaintObject
v extract Display.fillCircle
v Remove Swing imports from Solar
v Move eventhandlers to new class SolarFrame
v Fix backgroundcolor on drag
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment