forked from nus-cs2103-AY2324S1/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 #252 from ji-just-ji/master
Update DG with Storage, Add Command, use case and PPP
- Loading branch information
Showing
6 changed files
with
435 additions
and
6 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,53 @@ | ||
@startuml | ||
!include style.puml | ||
skinparam ArrowFontStyle plain | ||
|
||
box Logic LOGIC_COLOR_T1 | ||
participant "a:AddCommand" as AddCommand LOGIC_COLOR | ||
participant "<<class>>\nAddCommand" as AddCommandClass LOGIC_COLOR | ||
participant "m:Module" as Module LOGIC_COLOR | ||
participant "result:CommandResult" as CommandResult LOGIC_COLOR | ||
end box | ||
|
||
box Model MODEL_COLOR_T1 | ||
participant ":Model" as Model MODEL_COLOR | ||
end box | ||
|
||
[-> AddCommand : execute() | ||
activate AddCommand | ||
|
||
AddCommand -> Model : getModule("CS2040S") | ||
activate Model | ||
|
||
Model --> AddCommand : moduleToAdd | ||
deactivate Model | ||
|
||
AddCommand -> AddCommand : fillUserInputs(year, semester, grade) | ||
activate AddCommand | ||
|
||
create Module | ||
AddCommand -> Module | ||
activate Module | ||
Module --> AddCommand: m | ||
deactivate Module | ||
|
||
AddCommand --> AddCommand: moduleToAdd | ||
deactivate AddCommand | ||
|
||
AddCommand -> Model : addModule(moduleToAdd) | ||
activate Model | ||
|
||
Model --> AddCommand : newModule | ||
deactivate Model | ||
|
||
create CommandResult | ||
AddCommand -> CommandResult | ||
activate CommandResult | ||
|
||
CommandResult --> AddCommand : result | ||
deactivate CommandResult | ||
|
||
[<-- AddCommand : result | ||
deactivate AddCommand | ||
|
||
@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,89 @@ | ||
@startuml | ||
!include style.puml | ||
skinparam ArrowFontStyle plain | ||
|
||
box Logic LOGIC_COLOR_T1 | ||
participant ":LogicManager" as LogicManager LOGIC_COLOR | ||
participant ":ModulePlanParser" as ModulePlanParser LOGIC_COLOR | ||
participant ":AddCommandParser" as AddCommandParser LOGIC_COLOR | ||
participant "a:AddCommand" as AddCommand LOGIC_COLOR | ||
participant "result:CommandResult" as CommandResult LOGIC_COLOR | ||
end box | ||
|
||
box Model MODEL_COLOR_T1 | ||
participant "m:Module" as Module MODEL_COLOR | ||
participant "model:Model" as Model MODEL_COLOR | ||
end box | ||
[-> LogicManager : execute("Add CS2040S") | ||
activate LogicManager | ||
|
||
LogicManager -> ModulePlanParser : parseCommand("Add CS2040S y/1 s/1 g/A") | ||
activate ModulePlanParser | ||
|
||
create AddCommandParser | ||
ModulePlanParser -> AddCommandParser | ||
activate AddCommandParser | ||
|
||
AddCommandParser --> ModulePlanParser | ||
deactivate AddCommandParser | ||
|
||
ModulePlanParser -> AddCommandParser : parse(arg) | ||
activate AddCommandParser | ||
|
||
create AddCommand | ||
AddCommandParser -> AddCommand : new AddCommand("CS2040S", "1", "1", "A") | ||
activate AddCommand | ||
|
||
AddCommand --> AddCommandParser | ||
deactivate AddCommand | ||
|
||
AddCommandParser --> ModulePlanParser : a | ||
deactivate AddCommandParser | ||
'Hidden arrow to position the destroy marker below the end of the activation bar. | ||
AddCommandParser -[hidden]-> ModulePlanParser | ||
destroy AddCommandParser | ||
|
||
ModulePlanParser --> LogicManager : a | ||
deactivate ModulePlanParser | ||
|
||
LogicManager -> AddCommand : execute(model) | ||
activate AddCommand | ||
|
||
AddCommand -> Model : getModuleFromDb(moduelCode) | ||
activate Model | ||
Model --> AddCommand : newModule | ||
deactivate Model | ||
|
||
AddCommand -> AddCommand : fillUserInputs(year, semester, grade) | ||
activate AddCommand | ||
|
||
create Module | ||
AddCommand -> Module | ||
activate Module | ||
Module --> AddCommand: moduleToAdd | ||
deactivate Module | ||
|
||
|
||
AddCommand --> AddCommand: moduleToAdd | ||
deactivate AddCommand | ||
|
||
AddCommand -> Model : addModule(moduleToAdd) | ||
activate Model | ||
Model --> AddCommand | ||
deactivate Model | ||
|
||
create CommandResult | ||
AddCommand -> CommandResult : moduleToAdd | ||
activate CommandResult | ||
|
||
CommandResult --> AddCommand : result | ||
deactivate CommandResult | ||
|
||
AddCommand --> LogicManager : result | ||
deactivate AddCommand | ||
AddCommand -[hidden]-> LogicManager : result | ||
destroy AddCommand | ||
|
||
[<--LogicManager : result | ||
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,43 @@ | ||
@startuml | ||
!include style.puml | ||
skinparam ArrowFontStyle plain | ||
|
||
box Logic LOGIC_COLOR_T1 | ||
participant ":AddCommandParser" as AddCommandParser LOGIC_COLOR | ||
participant ":ParserUtil" as ParserUtil LOGIC_COLOR | ||
participant "a:AddCommand" as AddCommand LOGIC_COLOR | ||
end box | ||
|
||
[-> AddCommandParser : parse("add CS2040S y/1 s/1 g/A") | ||
activate AddCommandParser | ||
|
||
create ParserUtil | ||
AddCommandParser -> ParserUtil : parseModuleCode("CS2040S") | ||
activate ParserUtil | ||
ParserUtil --> AddCommandParser : moduleCode:ModuleCode | ||
|
||
AddCommandParser -> ParserUtil : parseModuleCode("1") | ||
ParserUtil --> AddCommandParser : moduleCode:ModuleCode | ||
|
||
AddCommandParser -> ParserUtil : parseModuleCode("1") | ||
ParserUtil --> AddCommandParser : moduleCode:ModuleCode | ||
|
||
AddCommandParser -> ParserUtil : parseModuleCode("A") | ||
ParserUtil --> AddCommandParser : moduleCode:ModuleCode | ||
|
||
deactivate ParserUtil | ||
|
||
create AddCommand | ||
AddCommandParser -> AddCommand : new AddCommand("CS2040S", amd) | ||
activate AddCommand | ||
|
||
AddCommand --> AddCommandParser : a | ||
deactivate AddCommand | ||
|
||
[<-- AddCommandParser : a | ||
deactivate AddCommandParser | ||
'Hidden arrow to position the destroy marker below the end of the activation bar. | ||
[<-[hidden]- AddCommandParser | ||
destroy AddCommandParser | ||
|
||
@enduml |
Oops, something went wrong.