Вы находитесь на странице: 1из 44

Puzzle Bubble Object-Oriented Analysis & Design with UML

COMP 2221 Software Engineering (Group 13)


==================================================================

Puzzle Bubble Software

Object-Oriented Analysis
&
Design with UML

By

Chan Po Ki Tiffany
03011577
&
Mak Ho Fai
03011798

COMP 2221
Lecturer: Prof. Jiming Liu
December 4, 2004

Professor Jiming Liu


Hong Kong Baptist University 1
Puzzle Bubble Object-Oriented Analysis & Design with UML
COMP 2221 Software Engineering (Group 13)
==================================================================
Table of Content
1.0 Introduction
1.1 Goals and objectives 4
1.2 System Statement of Scope 4
1.3 Software context 4
1.4 Major constraints 5
1.4.0 Running-time Constraint
1.4.1 Time Constraint
1.4.2 Resources Constraint
1.4.3 Running Platform
1.5 Notations 6-8
1.5.0 Notation for DFD
1.5.1 Notation for ERD
1.5.2 Notation for STD
1.5.3 Notation for Structural Chart
1.5.4 Notation for Use Case Diagram

2.0 Environmental Modeling


2.1 Event List 9
2.2 DFD Level 0 9
2.3 DFD Level 1 10
2.4 DFD Level 2 11 - 12
2.4.0 For Player Process
2.4.1 For Administration Process
2.5 DFD Level 3 13 - 15
2.5.0 For “Start Game” Process
2.5.1 For “End Game” Process
2.5.2 For “Option” Process
2.6 Process Specification 16 - 20
2.6.0 “Start Game” DFD
2.6.1 “End Game” DFD

3.0 Data Modeling


3.1 Entity-Relationship Diagram (ERD) 21 - 24
3.1.0 ERD for Stage Record
3.1.1 ERD for Password Record
3.1.2 ERD for Bubble Record
3.1.3 ERD for Position Record
3.1.4 ERD for Administrator
3.1.5 ERD for Score Record
3.2 Data Dictionary 25 – 29

4.0 Behavioral Modeling


4.1 State Transition Diagrams 30 - 32

Professor Jiming Liu


Hong Kong Baptist University 2
Puzzle Bubble Object-Oriented Analysis & Design with UML
COMP 2221 Software Engineering (Group 13)
==================================================================
5.0 Implementation Modeling
5.1 Transform Analysis 33
5.2 Structural Chart 34

6.0 Use Case Diagram 35

7.0 Class Diagram 36

8.0 Sequence Diagram


8.1 Login Sequence Diagram 37
8.2 Change of StagePWD Sequence Diagram 38
8.3 Play Sequence Diagram 39
8.4 Score Sequence Diagram 40-41

9.0 Appendix
9.1 Mindmaps 42-43

Professor Jiming Liu


Hong Kong Baptist University 3
Puzzle Bubble Object-Oriented Analysis & Design with UML
COMP 2221 Software Engineering (Group 13)
==================================================================
1.0 Introduction

1.1 Goals and Objectives

A Game Design Company, ABC, consigns us a game software project, Puzzle Bubble which
serves as an entertaining purpose. The goals are:

 To develop a user-friendly game


 To develop a game which is applicable to various platforms / medium
 To provide different modes for users to choose from

1.2 System Statement of Scope

 A way in which players can choose mode of game (VS or Story mode)
 A way in which players can choose a cartoon character representing player
 A way in which players can input their name if score is reached top 5
 A way in which promote to next stage if present stage is cleared
 A way in which link particular stage when password is input
 A way in which increase difficulties in respect to stages
 A way in which process linkage to 2nd Player (for VS mode)
 A way in which user can process “continue” or “new start” functions once game over
 A way in which output player’s score at the end of game
 A way in which output the ranking list for top 5 highest scores

1.3 Software Context

This software is specially designed for game support company which desire applying it to
portable technological devices such as palm, pocket PC, mobile phones. The software is
designed without many complicated functions for easy handling by users.

Professor Jiming Liu


Hong Kong Baptist University 4
Puzzle Bubble Object-Oriented Analysis & Design with UML
COMP 2221 Software Engineering (Group 13)
==================================================================

1.4 Major Constraints

1.4.0 Running-time Constraint


The speeds of processor of the pocket PC are varied from different models & brands,
so game needs to be designed in a simple basis so as to increase efficiency of running
the software.

1.4.1 Time Constraint


Due to limited time for the project, the game may only be applied to pocket PC
instead of palm or mobile phone.

1.4.2 Resources Constraint


As the software will be implemented in pocket PC, we need technical support for
making connection between device and software to make the game feasible. Besides,
we require at least two pockets PC for testing.

1.4.3 Running Platform


The software should be run on Windows 9x or Windows NT platform.

Professor Jiming Liu


Hong Kong Baptist University 5
Puzzle Bubble Object-Oriented Analysis & Design with UML
COMP 2221 Software Engineering (Group 13)
==================================================================

1.5 Notations

1.5.0 Notation for DFD Diagram

Notation for DFD Diagram

Ad m in istra to r Entity

Create Process
table

Process
Flow

Data Store
Database

Professor Jiming Liu


Hong Kong Baptist University 6
Puzzle Bubble Object-Oriented Analysis & Design with UML
COMP 2221 Software Engineering (Group 13)
==================================================================

1.5.1 Notation for E-R Diagram

Notation for E-R Diagram

Ad m in Entity

Ha ve Relationship

Cardinality Cardinality
Multiple Single

Cardinality Cardinality
Compulsory Optional

1.5.2 Notation for STD

Notation for State Transition Diagram

State States

Initial State

Exit State

Number Transitions/Actions/Events

Professor Jiming Liu


Hong Kong Baptist University 7
Puzzle Bubble Object-Oriented Analysis & Design with UML
COMP 2221 Software Engineering (Group 13)
==================================================================

1.5.3 Notation for Structural Chart

Notation for Structural Chart


Confirm Result
Control
Flow

Command to be
Executed

Data Flow

C O MMAND
Component
REC EIVE UNIT

Database Data Store

1.5.4 Notation for Use Case Diagram

Professor Jiming Liu


Hong Kong Baptist University 8
Puzzle Bubble Object-Oriented Analysis & Design with UML
COMP 2221 Software Engineering (Group 13)
==================================================================

The user of the system


Actor

Use Case

Communication between user & use case

<<include>>
include

Show the generalization of each use case

2.0 Environmental Modeling

2.1 Event List

The following event list aims to include all events that are invoked during the processes of
data flows.
Game result

Centra
End User Execute
l command

System

Input command /
password

2.2 DFD Level 0

Professor Jiming Liu


Hong Kong Baptist University 9
Puzzle Bubble Object-Oriented Analysis & Design with UML
COMP 2221 Software Engineering (Group 13)
==================================================================
Level 0 DFD

Pla ye r
Input Data

Central Display Information


Input Command Pla ye r
System

Ad m in istra to r
Input Command

2.3 DFD Level 1

Professor Jiming Liu


Hong Kong Baptist University 10
Puzzle Bubble Object-Oriented Analysis & Design with UML
COMP 2221 Software Engineering (Group 13)
==================================================================

Level 1 DFD

Pla ye r Ad m in istra to r

Admin Input Command


Player Input Data &
Command

Administrator
Process

Data Data

Data Database
Data
Player Process

Information

Pla ye r

2.4 DFD Level 2

Professor Jiming Liu


Hong Kong Baptist University 11
Puzzle Bubble Object-Oriented Analysis & Design with UML
COMP 2221 Software Engineering (Group 13)
==================================================================
2.4.0 For Player Process

Player Process DFD (Lv2)

Pla ye r

Start

Process Menu Process Option

Play
again

Process Mode
Process Exit
Process
Play Character

Data Data
Start Game

External
input

Database

End Game
Exit the
game

2.4.1 For Administration Process

Professor Jiming Liu


Hong Kong Baptist University 12
Puzzle Bubble Object-Oriented Analysis & Design with UML
COMP 2221 Software Engineering (Group 13)
==================================================================

Administration Process DFD

Ad m inistra to r

AdminID,
AdminPWD

Process Login

UpdatePWD

Data Data

Old PWD

Database
Stage Password
Change New PWD

2.5 DFD Level 3

Professor Jiming Liu


Hong Kong Baptist University 13
Puzzle Bubble Object-Oriented Analysis & Design with UML
COMP 2221 Software Engineering (Group 13)
==================================================================
2.5.0 For “Start Game” Process

“Start Game” DFD


(Lv3)

Start Game

Start

Get input
from Process Stage
keyboard

External Input
Gain stage
information from
database

Process
Process Score
Keep
Position
playing

Change
score
Save instance
change to database
Gain update
information
from database

Save action

End Game
Data

Data

To End Game

Database

2.5.1 For “End Game” Process

Professor Jiming Liu


Hong Kong Baptist University 14
Puzzle Bubble Object-Oriented Analysis & Design with UML
COMP 2221 Software Engineering (Group 13)
==================================================================
“End Game” DFD
(Lv3)

End Game

Release the password


of corresponding stage

Give Password

Process Score

Display the
score Enter
Name
Gain information
from database
Display

Save action
To menu

Process Menu
Save to database

To Menu

Database

2.5.2 For “Option” Process

Professor Jiming Liu


Hong Kong Baptist University 15
Puzzle Bubble Object-Oriented Analysis & Design with UML
COMP 2221 Software Engineering (Group 13)
==================================================================

“Option” DFD (Lv3)

Option
admit

To StartGame

Process Score EnterPassword


Generate the
ranking list

Display Set Difficulty

Get input Gain data from


from database
keyboard

Back to
ProcessMenu

Confirm?
Check to see if the
Delete Record Save action password is correct

Admin delete
the record
Data

Data

Process Menu

To End Game
Database

2.6 Process Specification

Professor Jiming Liu


Hong Kong Baptist University 16
Puzzle Bubble Object-Oriented Analysis & Design with UML
COMP 2221 Software Engineering (Group 13)
==================================================================
2.6.0 “Start Game” DFD
Name Start game Process stage
Informal To start the game by user 1) Process a particular
Description request stage by user request or
start from beginning
2) promote to next stage
Input Click “Start” button User enters password
Output Successful message Error / successful message
Source/Sink Users Users and database
Event A pop up window is A pop up window is activated
activated for a stage for a stage

Name Save action End game


Informal To save data of To terminate the game either
Description 1) location of arrow by user request or game over
which is commanded
by users
2) Score obtained (added)
by users once they can
clear three bubbles
with same color
Input 1) Press keyboards “left, User choose “Exit” button
right, up, down or
space”
2) Nil
Output 1) Show arrow’s position Successful message
2) Updated score
Source/Sink Users and database Users
Event A pop up window is “Game Over” screen is
activated displayed

Name External input / Process score


Process Position

Professor Jiming Liu


Hong Kong Baptist University 17
Puzzle Bubble Object-Oriented Analysis & Design with UML
COMP 2221 Software Engineering (Group 13)
==================================================================
Informal To get the users commands frequently update the score
Description for arrow movement and save which users obtained
its relative position
Input Press keyboards “left, right, Nil
up, down or space”
Output Show arrow’s position Updated score
Source/Sink Users and database Database
Event A arrow is pointed to users’ Score of user obtained is
desire location displayed and updated

2.6.1 “End Game” DFD


Name End game Give password

Professor Jiming Liu


Hong Kong Baptist University 18
Puzzle Bubble Object-Oriented Analysis & Design with UML
COMP 2221 Software Engineering (Group 13)
==================================================================
Informal To terminate the game either Password of latest stage is
Description by user request or game over given to user
Input User choose “Exit” button Nil
Output Successful message Password
Source/Sink Users Database
Event “Game Over” screen is A pop up window with
displayed password is activated

Name Process score Save action


Informal To check whether users’ final 1) Retrieve (update) score
Description score reach top 5 or not and record from database
retrieve user’s score at the and compare it with the
end of game from the score that user just
database obtained
2) If the score is reached
top 5, save user’s name
& score into database
Input Users’ names User’s name & score
Output Successful message Successful message
Source/Sink Users and database Users and database
Event Ranking screen is displayed A pop up window with
successful inserted data is
activated

Name Display Process menu


Informal To display the score that user To return the screen back to
Description obtained at the end of game “Menu” by user request
Input NIL User choose “Back to Menu”
button
Output Successful message Successful message
Source/Sink Users Users
Event Screen of displaying user’s “Menu” screen is displayed
score is activated

2.6.2 “Option” DFD


Name Option Process Score

Professor Jiming Liu


Hong Kong Baptist University 19
Puzzle Bubble Object-Oriented Analysis & Design with UML
COMP 2221 Software Engineering (Group 13)
==================================================================
Informal To access optional function To retrieve score record from
Description of the game the database
Input User click “Option” button Nil
Output Successful message Error / Successful message
Source/Sink Users and database Database
Event A pop up window with some A pop up window is activated
optional function is activated

Name Display Delete record


Informal To display the ranking list To delete the existing ranking
Description list by user request or
administrator maintenance
Input User click “Ranking list” User/Administrator click
button “Delete record” button
Output Successful message Confirmation (Yes/No)
message
Source/Sink Users and database Users and database
Event A pop up window with top 5 Display the empty ranking list
scores & names is displayed window or Exit

Name Process menu Set difficulty


Informal To return the screen back to To set the difficulty of the
Description “Menu” by user request game by user preference
Input User click “Back to Menu” User choose “Easy”,
button “Normal” or “Hard” button
Output Successful message Error / successful message
Source/Sink Users Users and database
Event “Menu” screen is displayed A pop up window back to
Option is activated

Name Save action Enter password


Informal To save data of User can directly play

Professor Jiming Liu


Hong Kong Baptist University 20
Puzzle Bubble Object-Oriented Analysis & Design with UML
COMP 2221 Software Engineering (Group 13)
==================================================================
Description 1) users input for particular stage by input its
difficulty preference & password & compare it with
link to database to the database record
retrieve the game
2) confirmation of delete
record and update
(delete) those scores
and names in the
database
3) password entered by
users and check
whether it is a
password for particular
stage in database &
retrieve for that stage
Input 1) User choose “Easy”, Password
“Normal” or “Hard”
button
2) User/Administrator
click “Delete record”
button
3) Password by users
Output Error / successful message Error / successful message
Source/Sink Users and database Users and database
Event A pop up window with Screen will switch to that
successful inserted data is particular stage
activated

3.0 Data Modeling

Professor Jiming Liu


Hong Kong Baptist University 21
Puzzle Bubble Object-Oriented Analysis & Design with UML
COMP 2221 Software Engineering (Group 13)
==================================================================

3.1 Entity-Relationship Diagram (ERD)

3.1.0 ERD for Stage Record


The following ERD illustrates the relationship built in each stage. Each
stage must have an unique StageID & backgroundID for the background
in particular stage.

Sta g e Re c o rd

Ha ve

Sta g e ID Ba c kg ro u n d ID

3.1.1 ERD for Password Record


Password record contains information of password of each stage. And so,
each stage only has an unique password.

Pa ssw o rd Re c o rd

Ha ve

P_Re c o rd

3.1.2 ERD for Bubble Record

Professor Jiming Liu


Hong Kong Baptist University 22
Puzzle Bubble Object-Oriented Analysis & Design with UML
COMP 2221 Software Engineering (Group 13)
==================================================================
The following diagram illustrates relationship built within each bubble.
Each bubble can be acted as instance bubble (I_Bubble), newly generated
bubble (C_bubble) or special feature bubble (S_Bubble). If it is a I-
bubble, means that it is located in a particular position. And so, it will
have I_Bubble_Name to specify its actual location by coordinates. If it is
a C_Bubble, means that it is going to shoot and its name and color will be
specified under C_Bubble_Name & C_Bubble_Color respectively. If it is
a S_Bubble, means that it has special function and it can have its unique
name (S_Bubble_Name).

Bu b b le Re c o rd

C o m p o se d b y

I_Bu b b le C _Bu b b le S_Bu b b le

Ha ve
Ha ve Ha ve

I_Bu b b le _Na m e C _Bu b b le _Na m e C _Bu b b le _C o lo r S_Bu b b le _Na m e

Professor Jiming Liu


Hong Kong Baptist University 23
Puzzle Bubble Object-Oriented Analysis & Design with UML
COMP 2221 Software Engineering (Group 13)
==================================================================
3.1.3 ERD for Position Record
Position record contains information about the status of each coordinate.
Each coordinate (position) must have an unique coordinate (X, Y), i.e.
(X-Co_Position, Y-Co_Position).

Po sitio nRe c o rd

Ha ve

X-C o _Po sitio n Y-C o _Po sitio n

3.1.4 ERD for Administrator


Each administrator has an unique ID and password (i.e. AdminID and
AdminPWD respectively) for software maintenance.

Ad m in

Ha ve

Ad m in ID Ad m in PWD

Professor Jiming Liu


Hong Kong Baptist University 24
Puzzle Bubble Object-Oriented Analysis & Design with UML
COMP 2221 Software Engineering (Group 13)
==================================================================
3.1.5 ERD for Score Record
Each player must have his/her unique instance score (I_Score) at the end
of the game. And Players’ scores (R_Score) and their names
(NameRecord) will be saved into the database once they reach top 5.

Sc o re Re c o rd

Ha ve

I_Sc o re R_Sc o re Na m e Re c o rd

Professor Jiming Liu


Hong Kong Baptist University 25
Puzzle Bubble Object-Oriented Analysis & Design with UML
COMP 2221 Software Engineering (Group 13)
==================================================================
3.2 Data Dictionary

AdminID
Type: String
Purpose This field contains the unique name of the administrator that is
set.
Informal The AdminID should be less than 8 digits which include
Description: character and number only
Related Comes from: Admin table
Processes Goes to: Admin/PasswordRecord table
Related Database
Objects
Range 1

AdminPWD
Type: String
Purpose This field contains the password of the administrator that is set
by himself
Informal The password should be at least 8 digits which may include
Description: character and number.
Related Comes from: Admin table
Processes Goes to: Admin/PasswordRecord table
Related Database
Objects
Range 1

StageID
Type: String
Purpose This field contains the default setting of bubbles that are already
existed on the screen in each different stage.
Informal Table name must be unique
Description:
Related Comes from: StageRecord table
Processes Goes to:
PositionRecord/BubbleRecord/ScoreRecord/PasswordRecord
table
Related Database
Objects
Range None

Professor Jiming Liu


Hong Kong Baptist University 26
Puzzle Bubble Object-Oriented Analysis & Design with UML
COMP 2221 Software Engineering (Group 13)
==================================================================

BackgroundID
Type: String
Purpose This field contains the default setting of background that are
already preset in each different stage.
Informal Table name must be unique. Mostly, we can query a table
Description: by its name.
Related Comes from: StageRecord table
Processes Goes to: StageRecord table
Related Database
Objects
Range None

X-Co_Position
Type: String
Purpose This field contains the information that if the x-coordinates of
the position that is still empty or occupied.
Informal Table name must be unique
Description:
Related Comes from: PositionRecord table
Processes
Goes to: BubbleRecord table
Related Database
Objects
Range None

Y-Co_Position
Type: String
Purpose This field contains the information that if the y-coordinates of
the position that is still empty or occupied.
Informal Table name must be unique
Description:
Related Comes from: PositionRecord table
Processes
Goes to: BubbleRecord table
Related Database
Objects
Range None

Professor Jiming Liu


Hong Kong Baptist University 27
Puzzle Bubble Object-Oriented Analysis & Design with UML
COMP 2221 Software Engineering (Group 13)
==================================================================

I_Bubble_Name
Type: String
Purpose This field contains the instance bubble name.
For example, R(0,0) ,it means the Red color bubble ball placed
on the top-left corner.
Informal Table name must be unique
Description:
Related Comes from: BubbleRecord table
Processes Goes to: PositionRecord/StageRecord table
Related Database
Objects
Range None

C_Bubble_Name
Type: String
Purpose This field contains the recorded score that the top-5 highest
score that maybe different user who get in different time.
Informal Table name must be unique
Description:
Related Comes from: BubbleRecord table
Processes Goes to: PositionRecord/StageRecord table
Related Database
Objects
Range None

C_Bubble_Color
Type: String
Purpose This field contains the coming bubble name that is generated
but not shoots out yet.
Informal Table name must be unique
Description:
Related Comes from: BubbleRecord table
Processes Goes to: PositionRecord/ StageRecord table
Related Database
Objects
Range None
Specification
(BNF)

Professor Jiming Liu


Hong Kong Baptist University 28
Puzzle Bubble Object-Oriented Analysis & Design with UML
COMP 2221 Software Engineering (Group 13)
==================================================================

S_Bubble_Name
Type: String
Purpose This field contains names of the special function bubble balls.
Informal Table name must be unique
Description:
Related Comes from: BubbleRecord table
Processes Goes to: PositionRecord/ StageRecord table
Related Database
Objects
Range None

I_Score
Type: String
Purpose This field contains the instance score that the user gets. It will
continuously to be added according the game still being play by
the user.

Informal Table name must be unique


Description:
Related Comes from: ScoreRecord/BubbleRecord table
Processes Goes to: StageRecord/ScoreRecord table
Related Database
Objects
Range None

R_Score
Type: String
Purpose This field contains the recorded score that the top-5 highest
score that maybe different user who get in different time.

Informal Table name must be unique


Description:
Related Comes from: ScoreRecord table
Processes Goes to: StageRecord/ScoreRecord table
Related Database
Objects
Range None

Professor Jiming Liu


Hong Kong Baptist University 29
Puzzle Bubble Object-Oriented Analysis & Design with UML
COMP 2221 Software Engineering (Group 13)
==================================================================

NameRecord
Type: String
Purpose This field contains the corresponding name entered by the top-5
highest score player.
Informal Table name must be unique
Description:
Related Comes from: ScoreRecord table
Processes Goes to: ScoreRecord table
Related Database
Objects
Range 5

P_Record
Type: String
Purpose This field contains different 4-Digit password that preset and
can be accessed directly to corresponding stage.
Informal The password must be 4 digits which may include character and
Description: number.
Related Comes from: PaswordRecord table
Processes Goes to: Stage table
Related Database
Objects
Range None

Professor Jiming Liu


Hong Kong Baptist University 30
Puzzle Bubble Object-Oriented Analysis & Design with UML
COMP 2221 Software Engineering (Group 13)
==================================================================
4.0 Behavioural Modeling

4.1 State Transition Diagram

4.1.0 Administrator Process STD

6
Login

1
Logout
1
5

2 Execute 3
Command

Modifying
Stage Modifying
Password 4 4 Score Record

Login button event, invoke read user option & input


Stage_Pwd button event, invoke modify stage password database
Score_record button event, invoke modify score record database
Exit button event, invoke exit from current page
Logout button event, invoke logout process
Fail, invoke re-login request

Professor Jiming Liu


Hong Kong Baptist University 31
Puzzle Bubble Object-Oriented Analysis & Design with UML
COMP 2221 Software Engineering (Group 13)
==================================================================

4.1.1 Player Process STD

START

10
Reading user 4 Choosing Starting
command play mode Game
5

1 2 3

11 15
Choose Go to Option Exit Process
character screen stage

5 6 7 8
Reading user
Choose Showing User enters 14 command
difficulty ranking list password

9
5
16
Deleting all
data in DB
Exit
5 3

Showing 13 Update score 12 Inputing 17 Giving


ranking list record in DB user’s name password

18

Professor Jiming Liu


Hong Kong Baptist University 32
Puzzle Bubble Object-Oriented Analysis & Design with UML
COMP 2221 Software Engineering (Group 13)
==================================================================
Illustrations

1 char_button event / invoke choose character request


2 option_button event / invoke access option menu
3 exit_button event / invoke exit process
4 mode_button event / invoke process function of choosing play mode
5 menu_button event / invoke request for back to Main Menu
6 difficulty_button event / invoke choose difficulty process
7 ranklist_button event / invoke access ranking list from database
8 passwd_button event / invoke request for entering a password
9 delete_button event / invoke delete data process
10 play_button event / invoke start game process
11 continue_button event / invoke process for game termination or continue
12 submit_button event / invoke process for submission of user data into database
13 display_button event / invoke process for extracting score record from database
and display it
14 retrieve StagePwd record from the database and compare it with password
entered by user and proceed that particular stage
15 “Yes” command is chosen by user
16 “No” command is chosen by user and invoke password retrieval for latest stage
from database
17 score that user obtained is reached top 5
18 score that user obtained can’t reach top 5

Professor Jiming Liu


Hong Kong Baptist University 33
Puzzle Bubble Object-Oriented Analysis & Design with UML
COMP 2221 Software Engineering (Group 13)
==================================================================

5.0 Implementation Modeling


5.1 Transform Analysis

1
Pla ye r Ad m in istra to r

Boundary Admin Input Command


Player Input Data & 2
Command

Administrator Boundary
Process
Transform
Center
Data Data

4
Data Database
Data
Player Process 3
拖曳側邊控點以
改變文字區塊的
寬度。

Information

Pu zzle
Pla ye r Bu b b le
O p e ra tio n

C o m m a nd
C o m m a nd Exe c u tio n
Re c e ive Un it
Pro c e ssin g
Sa ve Un it 3
Un it

1 2 O utp u t
Re su lt Un it 4

5.2 Structural Chart


Professor Jiming Liu
Hong Kong Baptist University 34
Puzzle Bubble Object-Oriented Analysis & Design with UML
COMP 2221 Software Engineering (Group 13)
==================================================================
PUZZLE BUBBLE
e O PERATIO N
b
to
and d Ex
mm ute ec
Co Exec Re ution
sul
t

ted e
ecu o b

t
Ex and t

sul
Re
mm

rm
C O MMAND

Co

Resu n

nfi
utio
REC EIVE UNIT

lt

Co
O UTPUT RESULT

Exec
UNIT

C O MMAND EXEC UTIO N


Execution

Execution
Execution

PRO C ESSING SAVE UNIT


Result

Result

Result
UNIT
Command to be

Confirm Result
Execution

Execution
Executed

Result

Result
G ET EXTERNAL PRO C ESS MENU
INPUT

Execution
LO G IN

Result
Database
Confirm Result
Command to be
Executed

DISPLAY

C HANG E STAG E
PASSWO RD

6.0 Use Case Diagram

Professor Jiming Liu


Hong Kong Baptist University 35
Puzzle Bubble Object-Oriented Analysis & Design with UML
COMP 2221 Software Engineering (Group 13)
==================================================================
«include»
Activate
Start game
the game

Player Score

Display
information Stage
Password «include»

«include»
Ranking
list
«include»
Database
«include»
Update
Record
«include»
Manage Delete
Database Record «include»

Change
Administrator
StagePwd

«include» input AdminID


Login
«include»
input AdminPwd

7.0 Class Diagram

Professor Jiming Liu


Hong Kong Baptist University 36
Puzzle Bubble Object-Oriented Analysis & Design with UML
COMP 2221 Software Engineering (Group 13)
==================================================================
1 1
Main Menu
Option Menu -choice : int
1 +buttonpress(choice) : boolean
1
1
1
Difficulty
-level : int Login Menu
+setDifficulty(level) : void -AdminID : int
-AdminPWD : String 1 Checking

<<instantiate>>
+getID(AdminID) : void 1
+getPWD(AdminPWD) : void
Database
1 -AdminID : int
-AdminPWD : String
-StageID : String
-BackgroundID : String
-P_Record : String
-R_Score : int

1 1
1
Score Stage
Checking
-I_Score : int -StageID : String
-R_Score : int -BackgroundID : String
+Update(I_Score) : void -P_Record : String 1
+Display(R_Score) : void +gotoStage(P_Record) :void
+Delete() : void
1

8.0 Sequence Diagram


8.1 Login Sequence Diagram

Professor Jiming Liu


Hong Kong Baptist University 37
Puzzle Bubble Object-Oriented Analysis & Design with UML
COMP 2221 Software Engineering (Group 13)
==================================================================

LoginMenu Database Database

User

Login(AdminID,AdminPWD)
false:=<undefined>login(ID,PWD)
ErrorMsg(login)

true:=<undefined>login(ID,PWD)
SuccessMsg(login)
AdminMenu

EnableUse()

Description of Login
 The interaction starts at the top of the diagram, and time flows down the diagram from
top to bottom.
 At the top of the diagram, there is an instance of the actor representing the user, the
login menu object, the database and the menu object. Each object shown has a dashed
line extending below its icon.
 When the login system receives the Login(AdminID,AdminPWD) data, it will check the
user information from the database.
 When the user inputted information checked in the databse by check(AdminID,
AdminPWD) method and returns true, SuccessMsg(login) will enable the login user to
use the functions in its user level. If it returns false, ErrorMsg(login) disappears.

8.2 Change of StagePWD Sequence Diagram

Professor Jiming Liu


Hong Kong Baptist University 38
Puzzle Bubble Object-Oriented Analysis & Design with UML
COMP 2221 Software Engineering (Group 13)
==================================================================

LoginMenu Database AdminMenu

Admin

Admin(ID,PWD)
true:=<undefined>login(ID,PWD)
SuccessMsg(login)

EnableUse()

UpdateStagePWD(OldPWD,NewPWD)
SuccessMsg(update)

Description of Change of StagePWD


 The interaction starts at the top of the diagram, and time flows down the diagram from
top to bottom.
 At the top of the diagram, there is an instance of the actor representing the user, the
login menu object, the database and the AdminMenu object. Each object shown has a
dashed line extending below its icon.
 When the loginMenu receives the Login(AdminID,AdminPWD) data, it will check the
user information from the database.
 When the user inputted information checked in the databse by check(AdminID,
AdminPWD) method and returns true, SuccessMsg(login) will enable the login user to
use the functions in its user level.
 Jump to AdminMenu and the administrator can update the stage password
UpdateStagePWD(OldPWD,NewPWD) by typing the new stage password instead of the
old stage password. Then the system will pop up the SuccessMsg(update) message.

8.3 Play Sequence Diagram

Professor Jiming Liu


Hong Kong Baptist University 39
Puzzle Bubble Object-Oriented Analysis & Design with UML
COMP 2221 Software Engineering (Group 13)
==================================================================

MainMenu Database

User

Selete(Play)
Get(StageData)
Send(StageData)

EndGame(Continue)

Send(Score)
Display(Score)

Description of Play
 The interaction starts at the top of the diagram, and time flows down the diagram from
top to bottom.
 At the top of the diagram, there is an instance of the actor representing the user, the
Main menu object and the database object. Each object shown has a dashed line
extending below its icon.
 When the user selected to start game, Get(StageData) will require the database send out
all necessary data for initial the game.
 When there is game over, EndGame(Continue) option will appear. If the user select yes,
it will loop and start the game again. If No, the score who got will send to database and
recorded with Send(Score) function. Database will also send back a Display(Score) to
display the top 5 highest score player.
8.4 Score Sequence Diagram

Professor Jiming Liu


Hong Kong Baptist University 40
Puzzle Bubble Object-Oriented Analysis & Design with UML
COMP 2221 Software Engineering (Group 13)
==================================================================

MainMenu Database AdminMenu

User Admin

Selete(Option)

Click(Option)

Display(score) Display(score)
SucessMsg(Display) SucessMsg(Display)

Delete(score) Delete(score)

Login(AdminID,AdminPWD)
SucessMsg(Display)

ConfirmMsg(Delete) ConfirmMsg(Delete)

Description of Score
 The interaction starts at the top of the diagram, and time flows down the diagram from
top to bottom.
 At the top of the diagram, there is an instance of the actor representing the user, the

Professor Jiming Liu


Hong Kong Baptist University 41
Puzzle Bubble Object-Oriented Analysis & Design with UML
COMP 2221 Software Engineering (Group 13)
==================================================================
Main menu object, the database and the AdminMenu object. Each object shown has a
dashed line extending below its icon.
 When the user Select(Option) , he/she click the “Option” button with Click(Option)
object, the main menu jump into option menu.
 Inside Option menu, user may choose to display the score with Display(Score)
instruction. Then a SuccessMsg(Display) will feedback and display the top 5 score.
 Inside Option menu, user may choose to delete the score with Delete(Score) instruction.
Then a ConfirmMsg(Delete) will feedback and score will be deleted when he/she click
“Yes”, but it will be cancelled when “No”.

It will be the same step and function when the administrator want to do the above
instructions.

9.0 Appendix
9.1 Summary of Mind Map

Professor Jiming Liu


Hong Kong Baptist University 42
Puzzle Bubble Object-Oriented Analysis & Design with UML
COMP 2221 Software Engineering (Group 13)
==================================================================
 Functions
o Menu
 Character
 Option
 Difficulty
 Ranking List
 Display Score
 Delete Record
 Input Password to access specific stage
 Exit
o Mode of game
 VS Mode
 Story Mode
o Play
 Continue
 Yes
 Re-play
 No
 Game Over
 Password will be given for latest stage
 Score reaches top 5
 Yes
 Display Score
 Enter players' names
 New start / Exit
 No
 Display Score
 New start / Exit

 Application
o palm / pocket PC

 Users
o Software Developers
 Read
 Write
 Modify

o IT Manager (Company Representative)


 Read
 Partial Modify
o Players

Professor Jiming Liu


Hong Kong Baptist University 43
Puzzle Bubble Object-Oriented Analysis & Design with UML
COMP 2221 Software Engineering (Group 13)
==================================================================
 Read
 Write (Names only)

< END >

Professor Jiming Liu


Hong Kong Baptist University 44

Вам также может понравиться