forked from nus-cs2103-AY2324S2/tp
-
Notifications
You must be signed in to change notification settings - Fork 4
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 #193 from solomonng2001/add-implementation-for-sor…
…t-birthday-priority-in-developer-guide Add DG implementation details for sorting, birthday and priority
- Loading branch information
Showing
5 changed files
with
253 additions
and
0 deletions.
There are no files selected for viewing
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
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,24 @@ | ||
@startuml | ||
!include style.puml | ||
skinparam objectFontColor white | ||
|
||
object "<u>:AddCommand</u>" as AddCommand LOGIC_COLOR | ||
object "<u>:AddCommandParser</u>" as AddCommandParser LOGIC_COLOR | ||
object "<u>:AddressBookParser</u>" as AddressBookParser LOGIC_COLOR | ||
object "<u>:Model</u>" as Model MODEL_COLOR | ||
object "<u>:CommandResult</u>" as CommandResult LOGIC_COLOR | ||
object "<u>toAdd:Person</u>" as Person LOGIC_COLOR | ||
object "<u>:ArgumentMultimap</u>" as ArgumentMultimap LOGIC_COLOR | ||
object "<u>:ParserUtil</u>" as ParserUtil LOGIC_COLOR | ||
|
||
AddressBookParser --> AddCommandParser : calls | ||
AddressBookParser --> AddCommand | ||
AddCommandParser -> AddCommand | ||
AddCommandParser --> ArgumentMultimap : instantiates | ||
ParserUtil --> ArgumentMultimap : parses | ||
AddCommand --> Person | ||
AddCommand --> Model | ||
AddCommand -right-> CommandResult : outputs | ||
Model -right-> Person : adds | ||
Model --> Person : set client to display as | ||
@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,60 @@ | ||
@startuml | ||
!include style.puml | ||
skinparam ArrowFontStyle plain | ||
|
||
box Logic LOGIC_COLOR_T1 | ||
participant ":LogicManager" as LogicManager LOGIC_COLOR | ||
participant ":AddressBookParser" as AddressBookParser LOGIC_COLOR | ||
participant "a:AddCommand" as AddCommand LOGIC_COLOR | ||
participant ":CommandResult" as CommandResult LOGIC_COLOR | ||
end box | ||
|
||
box Model MODEL_COLOR_T1 | ||
participant ":Model" as Model MODEL_COLOR | ||
end box | ||
[-> LogicManager : execute(...) | ||
activate LogicManager | ||
|
||
LogicManager -> AddressBookParser : parseCommand(...) | ||
activate AddressBookParser | ||
|
||
create AddCommand | ||
AddressBookParser -> AddCommand : AddCommand(...) | ||
activate AddCommand | ||
|
||
AddCommand --> AddressBookParser | ||
deactivate AddCommand | ||
|
||
AddressBookParser --> LogicManager : a | ||
deactivate AddressBookParser | ||
|
||
LogicManager -> AddCommand : execute() | ||
activate AddCommand | ||
|
||
AddCommand -> Model : addPerson(toAdd) | ||
activate Model | ||
|
||
Model --> AddCommand | ||
deactivate Model | ||
|
||
AddCommand -> Model : setDisplayClient(toAdd) | ||
activate Model | ||
|
||
Model --> AddCommand | ||
deactivate Model | ||
|
||
create CommandResult | ||
AddCommand --> CommandResult | ||
activate CommandResult | ||
|
||
CommandResult --> AddCommand | ||
deactivate CommandResult | ||
|
||
AddCommand --> LogicManager : result | ||
deactivate AddCommand | ||
AddCommand -[hidden]-> LogicManager : result | ||
destroy AddCommand | ||
|
||
[<--LogicManager | ||
deactivate LogicManager | ||
@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,29 @@ | ||
@startuml | ||
!include style.puml | ||
skinparam objectFontColor white | ||
|
||
object "<u>:SortCommand</u>" as SortCommand LOGIC_COLOR | ||
object "<u>:SortCommandParser</u>" as SortCommandParser LOGIC_COLOR | ||
object "<u>:AddressBookParser</u>" as AddressBookParser LOGIC_COLOR | ||
object "<u>:Model</u>" as Model MODEL_COLOR | ||
object "<u>:CommandResult</u>" as CommandResult LOGIC_COLOR | ||
object "<u>sortCriteria:SortCriteria</u>" as SortCriteria LOGIC_COLOR | ||
object "<u>sortOrder:SortOrder</u>" as SortOrder LOGIC_COLOR | ||
object "<u>:Comparator<Person></u>" as Comparator LOGIC_COLOR | ||
object "<u>:ArgumentMultimap</u>" as ArgumentMultimap LOGIC_COLOR | ||
object "<u>:ParserUtil</u>" as ParserUtil LOGIC_COLOR | ||
|
||
AddressBookParser --> SortCommandParser : calls | ||
AddressBookParser --> SortCommand | ||
SortCommandParser -> SortCommand | ||
SortCommandParser --> ArgumentMultimap : instantiates | ||
ParserUtil --> ArgumentMultimap : parses | ||
SortCommand --> Model | ||
SortCommand ---> SortCriteria : contains | ||
SortCommand ---> SortOrder : contains | ||
SortCommand --> Comparator : creates | ||
SortCommand -right-> CommandResult : outputs | ||
Comparator --> SortCriteria : uses | ||
Comparator --> SortOrder : uses | ||
Model --> Comparator : updates comparator to sort persons | ||
@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,68 @@ | ||
@startuml | ||
!include style.puml | ||
skinparam ArrowFontStyle plain | ||
|
||
box Logic LOGIC_COLOR_T1 | ||
participant ":LogicManager" as LogicManager LOGIC_COLOR | ||
participant ":AddressBookParser" as AddressBookParser LOGIC_COLOR | ||
participant "a:AddCommand" as AddCommand LOGIC_COLOR | ||
participant ":CommandResult" as CommandResult LOGIC_COLOR | ||
end box | ||
|
||
box Model MODEL_COLOR_T1 | ||
participant ":Model" as Model MODEL_COLOR | ||
participant "<<class>>\nPersonComparator" as PersonComparator MODEL_COLOR | ||
end box | ||
|
||
[-> LogicManager : execute(...) | ||
activate LogicManager | ||
|
||
LogicManager -> AddressBookParser : parseCommand(...) | ||
activate AddressBookParser | ||
|
||
create AddCommand | ||
AddressBookParser -> AddCommand : AddCommand(...) | ||
activate AddCommand | ||
|
||
AddCommand --> AddressBookParser | ||
deactivate AddCommand | ||
|
||
AddressBookParser --> LogicManager : a | ||
deactivate AddressBookParser | ||
|
||
LogicManager -> AddCommand : execute() | ||
activate AddCommand | ||
|
||
AddCommand -> PersonComparator : getComparator(sortCriteria, sortOrder) | ||
activate PersonComparator | ||
|
||
PersonComparator --> AddCommand : comparator | ||
deactivate PersonComparator | ||
|
||
AddCommand -> Model : updateSortPersonComparator(comparator) | ||
activate Model | ||
|
||
Model --> AddCommand | ||
deactivate Model | ||
|
||
AddCommand -> Model : setDisplayClientAsFirstInSortedFilteredPersonList() | ||
activate Model | ||
|
||
Model --> AddCommand | ||
deactivate Model | ||
|
||
create CommandResult | ||
AddCommand --> CommandResult | ||
activate CommandResult | ||
|
||
CommandResult --> AddCommand | ||
deactivate CommandResult | ||
|
||
AddCommand --> LogicManager : result | ||
deactivate AddCommand | ||
AddCommand -[hidden]-> LogicManager : result | ||
destroy AddCommand | ||
|
||
[<--LogicManager | ||
deactivate LogicManager | ||
@enduml |