Documente Academic
Documente Profesional
Documente Cultură
Documentation Report
Filename:
Status:
Date:
Author:
256201502.doc
draft
David Hill
256201502.doc
David Hill
3.1.2015
2 (27)
Table of contents
Ball Game project: Project Model.............................................................................................................3
Ball Game structure - analysis: Class Diagram [UML].........................................................................4
Ball Game structure - design: Class Diagram [UML]...........................................................................9
Ball Game behaviour - Design: Sequence Diagram............................................................................17
States of the Ball: State Machine Diagram..........................................................................................21
Ball Game requirements: Use Case Diagram......................................................................................27
256201502.doc
David Hill
3.1.2015
3 (27)
256201502.doc
David Hill
3.1.2015
4 (27)
Graph dictionary
Object
Ball
BallGame
Brick
Paddle
Wall
This model describes the class structure of the game identified in
the analysis phase.
Type of Object
Class [UML]
Class [UML]
Class [UML]
Class [UML]
Class [UML]
Note text
Documentation
256201502.doc
David Hill
Ball
+position
F
F
Ball relationships:
In role In relationship
: Part
: Aggregation
Ball links:
Link type
Decomposition
Explosions
With objects(s)
BallGame
In role
: Whole
Graph's name
none
none
BallGame
T
F
BallGame relationships:
In role
In relationship
: Whole : Aggregation
: Whole : Aggregation
With objects(s)
Paddle
Ball
In role
: Part
: Part
3.1.2015
5 (27)
256201502.doc
David Hill
: Whole
: Aggregation
BallGame links:
Link type
Decomposition
Explosions
Wall
: Part
Graph's name
none
none
Brick
F
F
Brick relationships:
In role In relationship
: Part
: Aggregation
Brick links:
Link type
Decomposition
Explosions
With objects(s)
Wall
Graph's name
none
none
In role
: Whole
3.1.2015
6 (27)
256201502.doc
David Hill
Paddle
F
F
Paddle relationships:
In role In relationship
: Part
: Aggregation
Paddle links:
Link type
Decomposition
Explosions
With objects(s)
BallGame
In role
: Whole
Graph's name
none
none
Wall
F
F
Wall relationships:
In role
In relationship
: Part
: Aggregation
With objects(s)
BallGame
In role
: Whole
3.1.2015
7 (27)
256201502.doc
David Hill
: Whole
: Aggregation
Wall links:
Link type
Decomposition
Explosions
Brick
3.1.2015
8 (27)
: Part
Graph's name
none
none
This model describes the class structure of the game identified in the analysis phase.:
Note text
Properties:
Documentation
This model describes the class structure of the game identified in the analysis
phase.
256201502.doc
David Hill
3.1.2015
9 (27)
Graph dictionary
Object
Type of Object
Ball
Class [UML]
BallGame
Brick
Class [UML]
Class [UML]
MovingObject
Class [UML]
Documentation
Ball is the basic element of the game. Player tries to remove
bricks by hitting them with the ball.
This is the main application class.
Single element of the wall. These will disappear, when the ball
hits them.
MovingObject is an abstract class for all moving components of
the ball game.
256201502.doc
David Hill
Paddle
TopScore
Wall
Class [UML]
Class [UML]
Class [UML]
3.1.2015
10 (27)
Player tries to keep the ball in play by hitting it with the paddle.
Stores one of the top scores and the player who achieved it.
Walls are generally immobile; the ball bounces back off them
giving no points.
: Specialization
Ball links:
Link type
Decomposition
Explosions
Ball
+void display() +void calculateNewDirection(MovingObject hitObject) +void
check position()
Game
F
F
Ball is the basic element of the game. Player tries to remove bricks by hitting
them with the ball.
F
In relationship
: Aggregation
: Generalization
[UML]
Graph's name
none
States of the Ball
With objects(s)
Paddle
Wall
Brick
BallGame
Paddle
In role
: Part
: Part
: Part
: Whole
: Specialization
Brick
Wall
MovingObject
: Specialization
: Specialization
: Superclass
256201502.doc
David Hill
3.1.2015
11 (27)
BallGame
#currentScore:int = 0 -ballsLeft:integer = 3 +playerName:String
+void displayGameOverText() +void displayPlayersScore() +void playTune()
+void decrementBalls() +void initialize()
Game
F
F
BallGame relationships:
In role
In relationship
: Whole
: Aggregation
: Whole
: Aggregation
BallGame links:
Link type
Decomposition
Explosions
With objects(s)
TopScore
Paddle
Ball
Wall
Brick
In role
: Part
: Part
: Part
: Part
: Part
Graph's name
none
none
Brick
+value:int = 1
+void playHitSound() +void increaseScore()
Game
F
F
Single element of the wall. These will disappear, when the ball hits them.
F
256201502.doc
David Hill
Brick relationships:
In role
: Part
In relationship
: Aggregation
: Specialization
Brick links:
Link type
Decomposition
Explosions
: Generalization
[UML]
3.1.2015
12 (27)
With objects(s)
Paddle
Ball
Wall
BallGame
Paddle
In role
: Part
: Part
: Part
: Whole
: Specialization
Ball
Wall
MovingObject
: Specialization
: Specialization
: Superclass
Graph's name
none
none
MovingObject
+position:Point = 100.0@100.0 -velocity:Point = 0.0@2.0 +extent:Point
-colour:ColorValue
+void display() +void move(Point position, int direction) +void checkHits()
Game
T
F
model
MovingObject relationships:
In role
In relationship
: Superclass
: Generalization
[UML]
MovingObject links:
Link type
Graph's name
Decomposition none
Explosions
none
With objects(s)
Paddle
In role
: Specialization
Ball
Brick
Wall
: Specialization
: Specialization
: Specialization
256201502.doc
David Hill
3.1.2015
13 (27)
: Specialization
Paddle links:
Link type
Decomposition
Explosions
Paddle
+maxSpeed
+void playHitSound()
Game
F
F
Player tries to keep the ball in play by hitting it with the paddle.
F
In relationship
: Aggregation
: Generalization
[UML]
Graph's name
none
none
With objects(s)
Ball
Wall
Brick
BallGame
Ball
In role
: Part
: Part
: Part
: Whole
: Specialization
Brick
Wall
MovingObject
: Specialization
: Specialization
: Superclass
256201502.doc
David Hill
3.1.2015
14 (27)
TopScore
+playerName:String +score:int = 0
Game
F
T
Stores one of the top scores and the player who achieved it.
F
TopScore relationships:
In role In relationship
: Part
: Aggregation
TopScore links:
Link type
Decomposition
Explosions
With objects(s)
BallGame
In role
: Whole
Graph's name
none
none
Wall
F
F
Walls are generally immobile; the ball bounces back off them giving no
points.
T
In relationship
: Aggregation
With objects(s)
Paddle
In role
: Part
256201502.doc
David Hill
: Specialization
Wall links:
Link type
Decomposition
Explosions
: Generalization
[UML]
Graph's name
none
none
3.1.2015
15 (27)
Ball
Brick
BallGame
Paddle
: Part
: Part
: Whole
: Specialization
Ball
Brick
MovingObject
: Specialization
: Specialization
: Superclass
256201502.doc
David Hill
3.1.2015
16 (27)
Graph dictionary
Object
:Ball
:BallGame
:Brick
:MovingObject
:Paddle
Outside actor
Type of Object
Lifeline object
Lifeline object
Lifeline object
Lifeline object
Lifeline object
Outside actor
Documentation
256201502.doc
David Hill
3.1.2015
17 (27)
Ball
F
:Ball relationships:
In role
In relationship
: Message to
check position: Call
: Message to
calculateNewDirection: Call
: Message to
calculateNewDirection: Call
: Return from : Return
: Return from position: Return
: Return from : Return
:Ball links:
Link type
Decomposition
Explosions
With objects(s)
:MovingObject
:MovingObject
:Paddle
:MovingObject
:MovingObject
:MovingObject
In role
: Message from
: Message from
: Message from
: Return to
: Return to
: Return to
Graph's name
none
none
BallGame
T
:BallGame relationships:
In role
In relationship
: Message from checkHits: Call
: Message from move: Call
: Message from displayGameOverText: Call
: Message from displayPlayersScore: Call
: Message to
decrementBalls: Call
: Message to
: Call
: Message to
displayGameOverText: Call
: Message to
displayPlayersScore: Call
: Return from
: Return
: Return to
: Return
:BallGame links:
Link type
Decomposition
Explosions
Graph's name
none
none
With objects(s)
:MovingObject
:MovingObject
:BallGame
:BallGame
:MovingObject
Outside actor
:BallGame
:BallGame
Outside actor
:MovingObject
In role
: Message to
: Message to
: Message to
: Message to
: Message from
: Message from
: Message from
: Message from
: Return to
: Return from
256201502.doc
David Hill
3.1.2015
18 (27)
Brick
F
:Brick relationships:
In role
In relationship
: Message to
increaseScore: Call
: Message to
playHitSound: Call
: Return from : Return
: Return from : Return
:Brick links:
Link type
Decomposition
Explosions
With objects(s)
:MovingObject
:MovingObject
:MovingObject
:MovingObject
In role
: Message from
: Message from
: Return to
: Return to
Graph's name
none
none
MovingObject
F
:MovingObject relationships:
In role
In relationship
: Message from increaseScore: Call
: Message from decrementBalls: Call
: Message from check position: Call
: Message from playHitSound: Call
: Message from calculateNewDirection: Call
: Message from playHitSound: Call
: Message to
checkHits: Call
: Message to
move: Call
: Return from
: Return
: Return to
: Return
: Return to
: Return
: Return to
position: Return
: Return to
: Return
: Return to
: Return
:MovingObject links:
Link type
Graph's name
Decomposition none
Explosions
none
With objects(s)
:Brick
:BallGame
:Ball
:Brick
:Ball
:Paddle
:BallGame
:BallGame
:BallGame
:Ball
:Brick
:Ball
:Ball
:Brick
In role
: Message to
: Message to
: Message to
: Message to
: Message to
: Message to
: Message from
: Message from
: Return to
: Return from
: Return from
: Return from
: Return from
: Return from
256201502.doc
David Hill
3.1.2015
19 (27)
Paddle
F
:Paddle relationships:
In role
In relationship
: Message from calculateNewDirection: Call
: Message to
playHitSound: Call
:Paddle links:
Link type
Decomposition
Explosions
With objects(s)
:Ball
:MovingObject
Graph's name
none
none
With objects(s)
:BallGame
:BallGame
In role
: Message to
: Return from
In role
: Message to
: Message from
256201502.doc
David Hill
3.1.2015
20 (27)
Graph dictionary
Object
This diagram describes the
states of the ball and possible
transitions between the states.
It reuses events and
operations from the class
diagram (e.g. initialize,
move,
calculateNewDirection).
Start
Behind the paddle
Type of Object
Note text
Start
State [UML]
Hits a brick
State [UML]
Hits a wall
State [UML]
Documentation
256201502.doc
David Hill
State [UML]
Initialized
State [UML]
Moving
State [UML]
Play a game
Stop
State [UML]
Stop
3.1.2015
21 (27)
This diagram describes the states of the ball and possible transitions between the
states. It reuses events and operations from the class diagram (e.g. initialize,
move, calculateNewDirection).: Note text
Properties:
Documentation
This diagram describes the states of the ball and possible transitions between
the states. It reuses events and operations from the class diagram (e.g.
initialize, move, calculateNewDirection).
With objects(s)
Initialized
In role
: To
Graph's name
none
none
256201502.doc
David Hill
With objects(s)
Initialized
Stop
Moving
3.1.2015
22 (27)
In role
: To
: To
: From
Hits a brick
entry / playHitSound entry / increaseScore(1) exit / calculateNewDirection
When the ball hits a brick the Hit sound is played, the brick's value is added
to the player's scores and new direction for the ball is calculated.
F
With objects(s)
Moving
Moving
In role
: To
: From
Hits a wall
entry / calculateNewDirection
When the ball hits the wall, a new direction for the ball is calculated.
F
With objects(s)
Moving
Moving
Graph's name
none
none
In role
: To
: From
256201502.doc
David Hill
3.1.2015
23 (27)
With objects(s)
Moving
Moving
In role
: To
: From
Initialized
Symbol transparent?
Initialized relationships:
In role In relationship
: From : Transition [UML]
: To
initialize: Transition [UML]
: To
decrementBalls: Transition [UML]
Initialized links:
Link type
Decomposition
Explosions
With objects(s)
Moving
Start
Behind the paddle
In role
: To
: From
: From
Graph's name
none
none
Moving
do / move
When the game has begun, the ball is mostly moving with the current
direction and speed.
F
Moving relationships:
In role In relationship
: From : Transition [UML]
: From : Transition [UML]
: From : Transition [UML]
With objects(s)
Behind the paddle
Hits a wall
Hits a brick
In role
: To
: To
: To
256201502.doc
David Hill
: From
: To
: To
: To
: To
: Transition [UML]
: Transition [UML]
: Transition [UML]
: Transition [UML]
: Transition [UML]
Moving links:
Link type
Decomposition
Explosions
: To
: From
: From
: From
: From
Graph's name
none
none
Play a game
T
With objects(s)
Behind the paddle
Graph's name
none
none
In role
: From
3.1.2015
24 (27)
256201502.doc
David Hill
3.1.2015
25 (27)
Graph dictionary
Object
Player
Ball game
Play a game
Type of Object
Actor [UML]
System [UML]
Use case [UML]
Documentation
Player who plays the ball game or views the high scores.
The user can play a game which a traditional ball game:
player moves the paddle and tries to remove the bricks from
the field by hitting them with the ball. The player has three
balls per game.
Scores of the best games and stored automatically and the
user can view top 10 list. The list includes scores and player
names.
Player
Player who plays the ball game or views the high scores.
Player relationships:
In role
In relationship
: Association role : Association [UML]
: Association role : Association [UML]
Player links:
Link type
Decomposition
Explosions
Graph's name
none
none
With objects(s)
Play a game
View high scores
In role
: Association role
: Association role
256201502.doc
David Hill
3.1.2015
26 (27)
Ball game
Graph's name
none
none
Play a game
The user can play a game which a traditional ball game: player moves the
paddle and tries to remove the bricks from the field by hitting them with the
ball. The player has three balls per game.
With objects(s)
Player
In role
: Association role
Scores of the best games and stored automatically and the user can view top 10
list. The list includes scores and player names.
With objects(s)
Player
In role
: Association role
256201502.doc
David Hill
3.1.2015
27 (27)