Refactoring Ball'java PowerPoint PPT Presentation

presentation player overlay
1 / 5
About This Presentation
Transcript and Presenter's Notes

Title: Refactoring Ball'java


1
Session 22
  • Refactoring Ball.java
  • CannonGame

2
Lets review Ball.java
  • What things do Balls know about themselves?
  • What actions can Balls respond to?

3
A couple of issues
  • toFront() issue from Monday
  • Closing issue from Monday
  • A multiple ball world that looks nicer on the
    edges (version 3)

4
Lets review Ball.java
  • What things do Balls know about themselves?
  • What actions can Balls respond to?
  • I actually wonder if Ball is multiple classes,
    inheriting from the other.
  • What might these be?

5
Refactoring Ball into three classes
  • Ball.java
  • Knows color, position, size, etc (very similar to
    the Circle.java class you are writing in HW6)
  • MoveableBall.java
  • Extends Ball
  • Is responsible for all actions pertaining to
    motion
  • BoundedBall.java
  • Worries about staying in bounds
  • (Version 4)
Write a Comment
User Comments (0)
About PowerShow.com