forked from nus-cs2103-AY2223S1/tp
-
Notifications
You must be signed in to change notification settings - Fork 6
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 #74 from cxyterence/update-dg
Update DeveloperGuide.md with implementation of ShowCommand
- Loading branch information
Showing
9 changed files
with
156 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,19 @@ | ||
@startuml | ||
'https://plantuml.com/object-diagram | ||
|
||
object "<u> Walter:Person" as Walter { | ||
position = "Professor" | ||
phone = "91234567" | ||
} | ||
|
||
object "<u> Jesse:Person" as Jesse { | ||
position = "Student" | ||
phone = "98765432" | ||
} | ||
|
||
map "<u> :AddressBook" as AddressBook { | ||
<u>:Person1 *-> Walter | ||
<u>:Person2 *--> Jesse | ||
} | ||
|
||
@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,17 @@ | ||
@startuml | ||
'https://plantuml.com/class-diagram | ||
class ShowCommand | ||
class Index {} | ||
|
||
ShowCommand *-- Index | ||
|
||
class ShowCommand { | ||
-COMMAND_WORD | ||
-index | ||
equals() | ||
execute() | ||
} | ||
class Index { | ||
-zeroBasedIndex = 1 | ||
} | ||
@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,20 @@ | ||
@startuml | ||
'https://plantuml.com/object-diagram | ||
|
||
object "<u> Walter:Person" as Walter { | ||
position = "Professor" | ||
phone = "91234567" | ||
} | ||
|
||
object "<u> Jesse:Person" as Jesse { | ||
position = "Student" | ||
phone = "98765432" | ||
} | ||
|
||
object "<u> :List<Person>" as lastShownList | ||
lastShownList --> Walter | ||
lastShownList --> Jesse | ||
|
||
object "<u> :CommandResult" as CommandResult | ||
CommandResult --> Walter | ||
@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,58 @@ | ||
@startuml | ||
!include style.puml | ||
|
||
box Logic LOGIC_COLOR_T1 | ||
participant ":LogicManager" as LogicManager LOGIC_COLOR | ||
participant ":AddressBookParser" as AddressBookParser LOGIC_COLOR | ||
participant "s:ShowCommand" as ShowCommand LOGIC_COLOR | ||
end box | ||
|
||
box Model MODEL_COLOR_T1 | ||
participant ":Model" as Model MODEL_COLOR | ||
participant ":List<Person>" as ListPerson MODEL_COLOR | ||
participant "personToShow:Person" as personToShow MODEL_COLOR | ||
end box | ||
[-> LogicManager : execute(show) | ||
activate LogicManager | ||
|
||
LogicManager -> AddressBookParser : parseCommand(show) | ||
activate AddressBookParser | ||
|
||
create ShowCommand | ||
AddressBookParser -> ShowCommand | ||
activate ShowCommand | ||
|
||
ShowCommand --> AddressBookParser | ||
deactivate ShowCommand | ||
|
||
AddressBookParser --> LogicManager : s | ||
deactivate AddressBookParser | ||
|
||
LogicManager -> ShowCommand : execute() | ||
activate ShowCommand | ||
|
||
ShowCommand -> Model : getFilteredPersonList() | ||
activate Model | ||
|
||
Model -> ListPerson | ||
activate ListPerson | ||
|
||
ListPerson -> personToShow : get(index.getZeroBased()) | ||
activate personToShow | ||
|
||
personToShow --> ListPerson | ||
deactivate personToShow | ||
|
||
ListPerson --> Model | ||
deactivate ListPerson | ||
|
||
Model --> ShowCommand : personToShow | ||
deactivate Model | ||
|
||
ShowCommand --> LogicManager | ||
deactivate ShowCommand | ||
|
||
[<-- LogicManager | ||
deactivate LogicManager | ||
|
||
@enduml |
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.