Professional Documents
Culture Documents
Analysis and Design Document
Analysis and Design Document
1> 1
Sinh viên:
Lê Văn Quý Hoàng
Trần Đình Hoàng Huy
Kiều Cao Khanh
Nguyễn Vẵn Quyền
Nguyễn Thị Hồng Nhung
Compare folder system NFD<v0.1> 2
Use-case diagram
Following descriptions are the detail explanation of the cases on the diagram.
*Note: N/A is the shortcut of Not Available.
Exceptions:
Includes: N/A
Specical Requirements: N/A
Assumptions: N/A
Notes and Issues: Client can choose folder only.
NFD004
Use Case ID:
Use Case Name: Cancel compare process
Created By: KhanhKC Last Updated By: KhanhKC
Date Created: 10/3/2015 Date Last Updated: 27/03/2015
Actor: Client
Description: Client wants to cancel the compare process when it’s running.
Preconditions: Compare process is running
Post - conditions: The compare process is stop.
Priority: High
Compare folder system NFD<v0.1> 7
MainScreen
Responsibilities Collaboration
+ displays control option for user interaction CompareProcess
+ handles detecting folders comparing DetailScreen
+ displays compare result
+ handles setting change criterion request
+ displays compare criterion configuration
settings
+ handles displaying compared detail
request
+ knows CompareProcess
+ knows DetailScreen
Compare folder system NFD<v0.1> 11
DetailScreen
Responsibilities Collaboration
+ displays compared detail result
RegisteredFolder
Responsibilities Collaboration
+ stores registered folder information
+ stores list files of each folder
CompareProcess
Responsibilities Collaboration
+ knows MainScreen MainScreen
+ knows RegisteredFolder RegisteredFolder
+ knows Result Result
+ knows CompareThread CompareThread
+ knows ScanFolderController ScanFolderController
+ knows CompareCOntroller CompareCOntroller
+ knows CriterionController CriterionController
+ knows DisplayController DisplayController
+ handle setting the configuration criterion
function.
+ handle choosing the folder function.
+ handle comparing process.
+ routes the request of client to extract
controller that handle request.
+ store all common data of process.
CompareThread
Responsibilities Collaboration
+ knows CompareProcess CompareProcess
+ knows ScanFolderController ScanFolderController
+ knows CompareController CompareController
+ knows CriterionController CriterionController
+ knows DisplayController DisplayController
+ knows DisplayThread DisplayThread
+ handle comparing process on a separate
thread
DisplayThread
Responsibilities Collaboration
+ knows DisplayController DisplayController
+ handle displaying result on a separate
thread
Compare folder system NFD<v0.1> 12
ScanFolderController
Responsibilities Collaboration
+ knows CompareProcess CompareProcess
+ knows ScanFolderLib, which is an ScanFolderLib
attached component from outside
application
+ handle choosing folder function
+ handle scanning all files of each folder to
system.
+ determine size of smaller folder.
CompareController
Responsibilities Collaboration
+ knows CompareController CompareProcess
+ knows Compare_Lib, which is an Compare_Lib
attached component from outside
application
+ determine same name files / different
name files/newer files/ newest file.
CriterionController
Responsibilities Collaboration
+ knows CompareProcess CompareProcess
+ knows Criterion1 (an example of an Criterion1
outside component)
+ register an outside component to system
+ handle checking all criterions
+ update data into CompareProcess
Criterion1
Responsibilities Collaboration
+ Process checking conditions according to
the separate rules.
Result
Responsibilities Collaboration
+ Stores compared result.
DisplayController
Responsibilities Collaboration
+ knows CompareProcess CompareProcess
+ knows Result Result
+ handle getting and displaying data to
main screen.
Compare folder system NFD<v0.1> 13
Interactive Diagram
Choose folders
ViewDetailResult
State-Machine diagram
Class Specification
MainScreen
Attributes
Name Type Initialize Description
cpObject CompareProcess Reference to
CompareProcess
Controller
Methods
Method Name registerObjects Scope private
Return Return Type Description
N/A None Register all elements that
need in system.
Parameter Type DefaultValue
N/A None N/A
Method Name show Scope public
Return Return Type Description
N/A None Displays control option for user
interaction
Parameter Type DefaultValue
N/A None
Method Name btnOpenFolder1ActionPerformed Scope private
Return Return Type Description
N/A None Handle choosing the first folder
Parameter Type DefaultValue
evt java.awt.event.ActionEvent
Method Name btnOpenFolder2ActionPerformed Scope private
Return Return Type Description
N/A None Handle choosing the second
folder
Parameter Type DefaultValue
evt java.awt.event.ActionEvent
Method Name btnCompareActionPerformed Scope private
Return Return Type Description
N/A None Handle comaring two folders
Parameter Type DefaultValue
evt java.awt.event.ActionEvent
Method Name btnCancelActionPerformed Scope private
Return Return Type Description
N/A None
Parameter Type DefaultValue
evt java.awt.event.ActionEvent
Method Name checkTheSameFolders Scope private
Return Return Type Description
N/A None Check if client chooses the
same folders to compare
Parameter Type DefaultValue
numFolder int N/A
Compare folder system NFD<v0.1> 18
CompareProcess
Attributes
Name Type Initialize Description
rFolder1 RegisteredFolder Reference to the
registered folder
rFolder2 RegisteredFolder Reference to the
registered folder
finalResult Result Reference to the
final result
cmpT CompareThread Reference to the
comparethread
lstObjGUI Object[] Store the list of object
lstKS HashMap<String,Controller> Reference to the map
of <String,Controller>
Methods
Method Name registerControllers Scope public
Return Return Type Description
N/A None Allows register controllers into system.
Each controller executes an separate
task.
Parameter Type DefaultValue
kSObject Controller N/A
Method Name chooseFolder1 Scope public
Return Return Type Description
N/A boolean Handles select folders to input path
into system
Parameter Type DefaultValue
N/A None N/A
Method Name chooseFolder2 Scope public
Return Return Type Description
N/A boolean Handles select folders to input path
into system
Parameter Type DefaultValue
N/A None N/A
Method Name compare Scope public
Return Return Type Description
N/A None Starts the comparing process
Parameter Type DefaultValue
N/A None N/A
Method Name cancelCompare Scope public
Return Return Type Description
N/A None Stop the comparing process
Parameter Type DefaultValue
N/A None N/A
Method Name emptyListFilesInFolder Scope public
Return Return Type Description
N/A None Empty the list file in Folder
Parameter Type DefaultValue
num int N/A
Method Name getMapFinalResult Scope public
Return Return Type Description
N/A HashMap<String,List<File[]>> Gets the final list result
Parameter Type DefaultValue
Compare folder system NFD<v0.1> 19
DetailScreen
Attributes
Name Type Initialize Description
header String[] Store the header of
the Detail Screen
Methods
Method Name DetailScreen Scope public
Return Return Type Description
N/A None
Parameter Type DefaultValue
header String[] N/A
dataFiles HashMap<String,List<File[]>> N/A
RegisteredFolder
Attributes
Name Type Initialize Description
folder File Reference to the file
lstFiles List<File> Store the list of files
Methods
Method Name setLstFiles Scope public
Return Return Type Description
N/A None
Parameter Type DefaultValue
lstFiles List<File> N/A
Method Name getLstFiles Scope public
Return Return Type Description
lstFiles List<File>
Parameter Type DefaultValue
Compare folder system NFD<v0.1> 20
Controller
Attributes
Name Type Initialize Description
cpObject CompareProcess Reference to the
compare process
nameController String Reference to the
name of controller
Methods
Method Name getNameController Scope public
Return Return Type Description
N/A String
Parameter Type DefaultValue
N/A None N/A
ScanFolderController
Attributes
Name Type Initialize Description
fComponent IFolderController Reference to the folder
controller
Methods
Method Name openFolder Scope public
Return Return Type Description
N/A boolean
Parameter Type DefaultValue
num int N/A
Method Name getListFile Scope public
Return Return Type Description
N/A None
Parameter Type DefaultValue
N/A None N/A
Method Name getCurrentFolder Scope public
Return Return Type Description
N/A File
Parameter Type DefaultValue
N/A None N/A
Method Name findSizeMinFolder Scope private
Return Return Type Description
N/A None
Parameter Type DefaultValue
Compare folder system NFD<v0.1> 21
CompareController
Attributes
Name Type Initialize Description
cmpComponent IComparator Reference to the
interfaceIComparator
Methods
Method Name doComparing Scope public
Return Return Type Description
N/A None
Parameter Type DefaultValue
N/A None N/A
CriterionController
Attributes
Name Type Initialize Description
logs ArrayList Store the list of logs
lstCriterions HashMap<String, ICriterion> Store the list of
criterions
Methods
Method Name registerCriterion Scope public
Return Return Type Description
N/A None
Parameter Type DefaultValue
crt IDetailCriterion N/A
Method Name checkCriterion Scope public
Return Return Type Description
N/A None
Parameter Type DefaultValue
N/A None N/A
Method Name setCriterion Scope public
Return Return Type Description
N/A None
Parameter Type DefaultValue
num int N/A
DisplayController
Attributes
Name Type Initialize Description
Rs Result Reference to the result
of compare process
Methods
Method Name displayStatus Scope public
Return Return Type Description
N/A None
Parameter Type DefaultValue
message String N/A
Method Name displayResult Scope public
Return Return Type Description
N/A None
Compare folder system NFD<v0.1> 22
CompareThread
Attributes
Name Type Initialize Description
t Thread Reference to the
thread
fdC ScanFolderController Reference to the scan
controller
cmpC CompareController Reference to the
compare controller
ctrC CriterionController Reference to the
criterion controller
dspT DisplayThread Reference to the
display thread
Methods
Method Name run Scope public
Return Return Type Description
N/A None
Parameter Type DefaultValue
N/A None N/A
Method Name start Scope public
Return Return Type Description
N/A None
Parameter Type DefaultValue
N/A None N/A
Method Name stop Scope public
Return Return Type Description
N/A None
Parameter Type DefaultValue
N/A None N/A
Compare folder system NFD<v0.1> 23
DisplayThread
Attributes
Name Type Initialize Description
t Thread Reference to the
thread
dsp DisplayController Reference to the
display controller
Methods
Method Name run Scope public
Return Return Type Description
N/A None
Parameter Type DefaultValue
N/A None N/A
Method Name triggerNotify Scope public
Return Return Type Description
N/A None
Parameter Type DefaultValue
N/A None N/A
Method Name start Scope public
Return Return Type Description
N/A None
Parameter Type DefaultValue
N/A None N/A
Result
Attributes
Name Type Initialize Description
newerFolder String Reference to the folder
result
newerPathFolder String The path of newer
folder
logs List<String> Reference to list logs
pathFolder1 String Path of the folder 1
pathFolder2 String Path of the folder 2
numFileOfFolder1 Int Number of files in
folder 1
numFileOfFolder2 Int Number of files in
folder 2
numSameFile Int Number of same files
in 2 folder
sizeMinFolder Int Size of the folder
whose fewer file
Methods
Method Name Scope
Return Return Type Description
N/A None
Parameter Type DefaultValue
N/A None N/A
Compare folder system NFD<v0.1> 24
Component diagram
ScanFolderLib
Initiator
Attributes
Name Type Initialize Description
Methods
Method Name init Scope public
Return Return Type Description
A IfolderController - Create new instance Folder
Controller
Parameter Type Default Value
IFolderController
Attributes
Name Type Initialize Description
Methods
Method Name openFolder Scope public
Return Return Type Description
FolderController
Attributes
Name Type Initialize Description
chooser JFileChooser Private
currentFolder File Private
lstFiles List<File> Private
Methods
Method Name getCurrentFolder Scope Public
Return Return Type Description
A File Get current Folder Info
Parameter Type Default Value
Method Name openFolder Scope Public
Return Return Type Description
A boolean Set current Folder Info
Parameter Type Default Value
Method Name getListFileOfFolder Scope Public
Return Return Type Description
A List<File> Get List file in Folder
Compare folder system NFD<v0.1> 26
Criterion1Lib
Initiator
Attributes
Name Type Initialize Description
N/A
Methods
Method Name init Scope public
Return Return Type Description
A ICriterion Create new instance of ICriterion
Parameter Type Default Value
ICriterion
Attributes
Name Type Initialize Description
N/A
Methods
Method Name checkCriterion Scope public
Return Return Type Description
A boolean Check criterion of folder
Parameter Type Default Value
lstFinalResul HashMap<String,
List<File[]>>
sizeMinFolder int
Methods
Method Name getLogs Scope public
Return Return Type Description
A List<String>
Parameter Type Default Value
Methods
Method Name getCriterion Scope public
Return Return Type Description
A/A
Parameter Type Default Value
IDetailCriterion
Attributes
Name Type Initialize Description
nameCriterion String
Methods
Method Name String Scope public
Return Return Type Description
A nameCriterion Create new instance of Criterion1
Parameter Type Default Value
Methods
Method Name setCriterion Scope public
Return Return Type Description
N/A
Parameter Type Default Value
Compare folder system NFD<v0.1> 28
criterion int
Criterion1
Attributes
Name Type Initialize Description
percentDefault Int
logs List<String>
newerFolder String
numSameFile int
Methods
Method Name Criterion1 Scope public
Return Return Type Description
N/A
Parameter Type Default Value
Methods
Method Name checkCriterion Scope public
Return Return Type Description
A Bollean
Parameter Type Default Value
lstFinalResul HashMap<String, List<File[]>>
sizeMinFolder int
Methods
Method Name getLogs Scope public
Return Return Type Description
A List<String>
Parameter Type Default Value
Methods
Method Name setCriterion Scope public
Return Return Type Description
A int
Parameter Type Default Value
Methods
Method Name getNewerFolder Scope public
Return Return Type Description
A String
Parameter Type Default Value
Methods
Method Name getNumSameFile Scope public
Return Return Type Description
A int
Parameter Type Default Value
Methods
Method Name getCriterion Scope public
Return Return Type Description
Compare folder system NFD<v0.1> 29
A IDetailCriterion
Parameter Type Default Value
s
Methods
Method Name checkPercentCondition Scope public
Return Return Type Description
A Boolean
Parameter Type Default Value
lstFinalResul HashMap<String, List<File[]>>
sizeMinFolder int
Methods
Method Name checkIfAllFilesAreTheSameModifiedDate Scope public
Return Return Type Description
A Boolean
Parameter Type Default Value
lstFinalResuls HashMap<String, List<File[]>>
Methods
Method Name checkIfAnyFileIsTheNewest Scope public
Return Return Type Description
A Boolean
Parameter Type Default Value
lstFinalResul HashMassp<String, List<File[]>>
Methods
Method Name checkIfOneSideIsTotalNewer Scope public
Return Return Type Description
A Boolean
Parameter Type Default Value
lstFinalResul HashMap<String, List<File[]>>
Compare folder system NFD<v0.1> 30
CompareLib
CompareInitiator
Attributes
Name Type Initialize Description
Methods
Method Name init Scope public
Return Return Type Description
N/A IComparator Create new instance Comparator
Parameter Type Default Value
IComparator
Attributes
Name Type Initialize Description
Compare folder system NFD<v0.1> 31
Methods
Method Name startCompare Scope public
Return Return Type Description
A HashMap<String, Compare two folder
List<File[]>>
Parameter Type Default Value
dirMasterA String
dirMasterB String
fileList1 List<File>
fileList2 List<File>
Methods
Method Name stopCompare Scope public
Return Return Type Description
N/A
Parameter Type Default Value
Methods
Method Name pauseCompare Scope public
Return Return Type Description
N/A
Parameter Type Default Value
Methods
Method Name resumeCompare Scope public
Return Return Type Description
N/A
Parameter Type Default Value
Comparator
Attributes
Name Type Initialize Description
Methods
Method Name getRelativePath Scope public
Return Return Type Description
A Path Get Relative of file choosed.
Parameter Type Default Value
children String
master String
Methods
Method Name startCompare Scope public
Return Return Type Description
A HashMap<String, Get Relative of file choosed.
List<File[]>>
Parameter Type Default Value
children String
master String
Methods
Compare folder system NFD<v0.1> 32
Methods
Method Name pauseCompare Scope public
Return Return Type Description
Methods
Method Name resumeCompare Scope public
Return Return Type Description