Refactoring Ball'java - PowerPoint PPT Presentation

1 / 5
About This Presentation
Title:

Refactoring Ball'java

Description:

... change the color of the cannonball from blue to red to ... Place the 'change color' button in a Panel with the 'fire' button along the top of the window. ... – PowerPoint PPT presentation

Number of Views:18
Avg rating:3.0/5.0
Slides: 6
Provided by: BenSc
Category:
Tags: ball | java | refactoring

less

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