forked from nus-cs2103-AY2425S1/tp
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #334 from Clarenceeey/update/DG
Put sequence diagrams for consultations
- Loading branch information
Showing
12 changed files
with
415 additions
and
99 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
@startuml | ||
|
||
!include ../style.puml | ||
|
||
skinparam arrowThickness 1.1 | ||
skinparam arrowColor LOGIC_COLOR_T4 | ||
skinparam classBackgroundColor LOGIC_COLOR | ||
|
||
title Add Consult Command and Parser UML Diagram | ||
package Logic { | ||
|
||
package Commands { | ||
Class "{abstract}\nCommand" as Command | ||
Class AddConsultCommand | ||
Class CommandResult | ||
} | ||
|
||
package "Parser Classes" { | ||
Class AddConsultCommandParser | ||
} | ||
} | ||
|
||
package Model { | ||
Class Consultation | ||
Class Student | ||
Class Date | ||
Class Time | ||
} | ||
|
||
' Command relationships | ||
Command <|-- AddConsultCommand | ||
Command ..> CommandResult : creates > | ||
|
||
' Parser relationships | ||
AddConsultCommandParser ..> AddConsultCommand : creates > | ||
|
||
' Model relationships | ||
Consultation *-- "*" Student | ||
Consultation *-- "1" Date | ||
Consultation *-- "1" Time | ||
|
||
' Group visibility for logical structure | ||
CommandResult ..> Consultation : creates > | ||
|
||
@enduml |
84 changes: 84 additions & 0 deletions
84
docs/diagrams/Consults/SequenceDiagramAddToConsultCommand.puml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
|
||
@startuml | ||
!include ../style.puml | ||
skinparam ArrowFontStyle plain | ||
|
||
title AddToConsultCommand Sequence Diagram | ||
|
||
box Logic | ||
participant ":LogicManager" as LogicManager LOGIC_COLOR | ||
participant ":AddressBookParser" as addressBookParser LOGIC_COLOR_T3 | ||
participant ":AddToConsultCommandParser" as AddToConsultCommandParser LOGIC_COLOR_T2 | ||
participant ":AddToConsultCommand" as AddToConsultCommand LOGIC_COLOR_T1 | ||
participant ":CommandResult" as CommandResult LOGIC_COLOR | ||
end box | ||
|
||
box Model MODEL_COLOR_T1 | ||
Participant ":Model" as model MODEL_COLOR | ||
end box | ||
|
||
-[UI_COLOR]> LogicManager : execute("addtoconsult 1 n/John Doe i/3") | ||
activate LogicManager LOGIC_COLOR | ||
|
||
'Logic manager calls AddressBookParser and passes the command | ||
LogicManager -[LOGIC_COLOR]> addressBookParser : parseCommand("addtoconsult 1 n/John Doe i/3") | ||
activate addressBookParser LOGIC_COLOR_T3 | ||
|
||
'AddressBookParser creates an instance of the parser | ||
create AddToConsultCommandParser | ||
addressBookParser -[LOGIC_COLOR_T3]> AddToConsultCommandParser : | ||
activate AddToConsultCommandParser LOGIC_COLOR_T2 | ||
|
||
AddToConsultCommandParser --[LOGIC_COLOR_T2]> addressBookParser | ||
deactivate AddToConsultCommandParser | ||
|
||
' AddressBookParser calls the parse command | ||
addressBookParser -[LOGIC_COLOR_T3]> AddToConsultCommandParser : parse("1 n/John Doe i/3") | ||
activate AddToConsultCommandParser LOGIC_COLOR_T2 | ||
|
||
'Within the parse command, the parser creates an instance of the command | ||
create AddToConsultCommand | ||
AddToConsultCommandParser --[LOGIC_COLOR_T2]> AddToConsultCommand : | ||
activate AddToConsultCommand LOGIC_COLOR_T1 | ||
|
||
AddToConsultCommand --[LOGIC_COLOR]> AddToConsultCommandParser | ||
deactivate AddToConsultCommand LOGIC_COLOR_T1 | ||
|
||
'parser returns the command to the AddressBookParser | ||
AddToConsultCommandParser --[LOGIC_COLOR_T2]> addressBookParser : AddToConsultCommand | ||
deactivate AddToConsultCommandParser | ||
|
||
AddToConsultCommandParser --[hidden]> addressBookParser : AddToConsultCommand | ||
destroy AddToConsultCommandParser | ||
|
||
addressBookParser --[LOGIC_COLOR_T3]> LogicManager : AddToConsultCommand | ||
deactivate addressBookParser | ||
|
||
'LogicManager calls command.execute | ||
LogicManager -[LOGIC_COLOR]> AddToConsultCommand : execute(model) | ||
activate AddToConsultCommand LOGIC_COLOR_T1 | ||
|
||
'get filteredConsultationList | ||
AddToConsultCommand -[LOGIC_COLOR]> model : addStudent(student) | ||
activate model MODEL_COLOR | ||
|
||
|
||
model -[MODEL_COLOR]-> AddToConsultCommand | ||
deactivate model | ||
|
||
create CommandResult | ||
AddToConsultCommand --[LOGIC_COLOR_T2]> CommandResult | ||
activate CommandResult LOGIC_COLOR | ||
CommandResult --[LOGIC_COLOR]> AddToConsultCommand | ||
deactivate CommandResult | ||
|
||
|
||
'After adding students, return new consultation | ||
AddToConsultCommand --[LOGIC_COLOR]> LogicManager : CommandResult | ||
deactivate AddToConsultCommand LOGIC_COLOR_T1 | ||
AddToConsultCommand --[hidden]> LogicManager : CommandResult | ||
destroy AddToConsultCommand | ||
|
||
[<-[UI_COLOR]-LogicManager : CommandResult | ||
|
||
@enduml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
@startuml | ||
!include ../style.puml | ||
skinparam ArrowFontStyle plain | ||
|
||
title addStudent Method Sequence Diagram | ||
|
||
box Logic | ||
participant ":AddToConsultCommand" as client LOGIC_COLOR | ||
end box | ||
|
||
box Model | ||
participant ":Consultation" as consultation MODEL_COLOR | ||
end box | ||
|
||
|
||
|
||
client -> consultation : addStudent(student) | ||
activate consultation | ||
|
||
consultation -> consultation : hasStudent(student) | ||
activate consultation | ||
|
||
consultation -> consultation : | ||
deactivate consultation | ||
|
||
alt student already in consult | ||
|
||
consultation -> client : nothing is added, exception thrown | ||
|
||
else student not in consult | ||
|
||
consultation -> client : student added to consult successfully | ||
|
||
end alt | ||
|
||
deactivate consultation | ||
|
||
@enduml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.