forked from nus-cs2103-AY1920S2/addressbook-level3
-
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 #148 from zhuhanming/dev-guide-init
Dev guide init
- Loading branch information
Showing
32 changed files
with
468 additions
and
106 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
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
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,20 @@ | ||
@startuml | ||
!include style.puml | ||
|
||
box Logic LOGIC_COLOR_T1 | ||
participant ":LogicManager" as LogicManager LOGIC_COLOR | ||
participant ":AddModuleStatefulLogicManager" as AddModuleStatefulLogicManager LOGIC_COLOR | ||
participant ":ModuloParser" as ModuloParser LOGIC_COLOR | ||
end box | ||
|
||
[-> LogicManager : execute("D09") | ||
activate LogicManager | ||
activate AddModuleStatefulLogicManager | ||
alt AddModuleStatefulLogicManager has state | ||
LogicManager -> AddModuleStatefulLogicManager : execute("D09") | ||
|
||
else else | ||
LogicManager -> ModuloParser : parseCommand("D09") | ||
activate ModuloParser | ||
end | ||
@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,73 @@ | ||
@startuml | ||
!include style.puml | ||
|
||
box Logic LOGIC_COLOR_T1 | ||
participant ":LogicManager" as LogicManager LOGIC_COLOR | ||
participant ":ModuloParser" as ModuloParser LOGIC_COLOR | ||
participant ":AddModuleCommandParser" as AddModuleCommandParser LOGIC_COLOR | ||
participant "a:AddModuleCommand" as AddModuleCommand LOGIC_COLOR | ||
participant "result:AddModuleCommandResult" as AddModuleCommandResult LOGIC_COLOR | ||
end box | ||
|
||
box Model MODEL_COLOR_T1 | ||
participant ":Model" as Model MODEL_COLOR | ||
end box | ||
|
||
[-> LogicManager : execute("module m/CS2103") | ||
activate LogicManager | ||
|
||
LogicManager -> ModuloParser : parseCommand("module m/CS2103") | ||
activate ModuloParser | ||
|
||
create AddModuleCommandParser | ||
ModuloParser -> AddModuleCommandParser | ||
activate AddModuleCommandParser | ||
|
||
AddModuleCommandParser --> ModuloParser | ||
deactivate AddModuleCommandParser | ||
|
||
ModuloParser -> AddModuleCommandParser : parse("m/CS2103") | ||
activate AddModuleCommandParser | ||
|
||
create AddModuleCommand | ||
AddModuleCommandParser -> AddModuleCommand | ||
activate AddModuleCommand | ||
|
||
AddModuleCommand --> AddModuleCommandParser : a | ||
deactivate AddModuleCommand | ||
|
||
AddModuleCommandParser --> ModuloParser : a | ||
deactivate AddModuleCommandParser | ||
'Hidden arrow to position the destroy marker below the end of the activation bar. | ||
AddModuleCommandParser -[hidden]-> ModuloParser | ||
destroy AddModuleCommandParser | ||
|
||
ModuloParser --> LogicManager : a | ||
deactivate ModuloParser | ||
|
||
LogicManager -> AddModuleCommand : execute() | ||
activate AddModuleCommand | ||
|
||
group State Preparation | ||
AddModuleCommand -> Model : addModule("CS2103") | ||
activate Model | ||
|
||
Model --> AddModuleCommand | ||
deactivate Model | ||
|
||
create AddModuleCommandResult | ||
AddModuleCommand -> AddModuleCommandResult | ||
activate AddModuleCommandResult | ||
|
||
AddModuleCommandResult --> AddModuleCommand | ||
deactivate AddModuleCommandResult | ||
end | ||
|
||
group State Loading | ||
AddModuleCommand --> LogicManager : result | ||
deactivate AddModuleCommand | ||
end | ||
|
||
[<--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,25 @@ | ||
@startuml | ||
!include style.puml | ||
|
||
box Logic LOGIC_COLOR_T1 | ||
participant ":LogicManager" as LogicManager LOGIC_COLOR | ||
participant ":AddModuleStatefulLogicManager" as AddModuleStatefulLogicManager LOGIC_COLOR | ||
participant ":XStatefulLogicManager" as XStatefulLogicManager LOGIC_COLOR | ||
participant ":ModuloParser" as ModuloParser LOGIC_COLOR | ||
end box | ||
|
||
[-> LogicManager : execute("D09") | ||
activate LogicManager | ||
activate AddModuleStatefulLogicManager | ||
|
||
alt AddModuleStatefulLogicManager has state | ||
LogicManager -> AddModuleStatefulLogicManager : execute("D09") | ||
|
||
else XStatefulLogicManager has state | ||
LogicManager -> XStatefulLogicManager : execute("D09") | ||
|
||
else else | ||
LogicManager -> ModuloParser : parseCommand("D09") | ||
activate ModuloParser | ||
end | ||
@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,36 @@ | ||
@startuml | ||
!include style.puml | ||
|
||
box Logic LOGIC_COLOR_T1 | ||
participant ":LogicManager" as LogicManager LOGIC_COLOR | ||
participant "a:AddModuleCommand" as AddModuleCommand LOGIC_COLOR | ||
participant "result:AddModuleCommandResult" as AddModuleCommandResult LOGIC_COLOR | ||
participant ":AddModuleStatefulLogicManager" as AddModuleStatefulLogicManager LOGIC_COLOR | ||
end box | ||
|
||
activate AddModuleCommand | ||
activate LogicManager | ||
activate AddModuleStatefulLogicManager | ||
|
||
create AddModuleCommandResult | ||
AddModuleCommand -> AddModuleCommandResult | ||
activate AddModuleCommandResult | ||
|
||
AddModuleCommandResult --> AddModuleCommand | ||
deactivate AddModuleCommandResult | ||
|
||
group State Loading | ||
AddModuleCommand --> LogicManager : result | ||
deactivate AddModuleCommand | ||
|
||
opt result instanceof AddModuleCommandResult | ||
LogicManager -> AddModuleStatefulLogicManager: setStateWithCommandResult(result) | ||
AddModuleStatefulLogicManager --> LogicManager | ||
|
||
end | ||
end | ||
|
||
[<--LogicManager | ||
deactivate AddModuleStatefulLogicManager | ||
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,41 @@ | ||
@startuml | ||
!include style.puml | ||
|
||
box Logic LOGIC_COLOR_T1 | ||
participant "a:AddModuleCommand" as AddModuleCommand LOGIC_COLOR | ||
participant "result:AddModuleCommandResult" as AddModuleCommandResult LOGIC_COLOR | ||
end box | ||
|
||
box Model MODEL_COLOR_T1 | ||
participant ":Model" as Model MODEL_COLOR | ||
participant ":ModuleLibrary" as ModuleLibrary MODEL_COLOR | ||
end box | ||
|
||
activate AddModuleCommand | ||
|
||
group State Preparation | ||
AddModuleCommand -> Model : addModule(moduleCode, academicYear) | ||
activate Model | ||
|
||
Model --> AddModuleCommand | ||
deactivate Model | ||
|
||
AddModuleCommand -> Model: getModule(moduleCode, academicYear) | ||
activate Model | ||
Model --> AddModuleCommand: module: Module | ||
deactivate Model | ||
|
||
AddModuleCommand -> ModuleLibrary: getEventTypesOfModule(module) | ||
activate ModuleLibrary | ||
ModuleLibrary --> AddModuleCommand: eventTypes: List<EventType> | ||
note left: eventTypes will later\nserve as the state | ||
deactivate ModuleLibrary | ||
|
||
create AddModuleCommandResult | ||
AddModuleCommand -> AddModuleCommandResult: module, eventTypes | ||
activate AddModuleCommandResult | ||
|
||
AddModuleCommandResult --> AddModuleCommand | ||
deactivate AddModuleCommandResult | ||
end | ||
@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,34 @@ | ||
@startuml | ||
!include style.puml | ||
show members | ||
skinparam classAttributeFontColor #FFFFFFF | ||
skinparam classAttributeIconSize 0 | ||
skinparam arrowThickness 1.1 | ||
skinparam arrowColor LOGIC_COLOR_T4 | ||
skinparam classBackgroundColor LOGIC_COLOR | ||
|
||
Package StatefulLogic { | ||
|
||
class StatefulLogic <<interface>> { | ||
+hasState(): boolean | ||
+setStateWithCommandResult(commandResult: CommandResult): void | ||
+execute(commandText: String): CommandResult | ||
} | ||
|
||
class AddModuleStatefulLogicManager { | ||
-module: Module | ||
} | ||
|
||
AddModuleStatefulLogicManager .up.|> StatefulLogic | ||
} | ||
|
||
Package Model { | ||
hide members | ||
class EventType <<enumeration>> MODEL_COLOR | ||
class Model MODEL_COLOR | ||
} | ||
|
||
AddModuleStatefulLogicManager "1"-right->"1" Model | ||
AddModuleStatefulLogicManager "1"-right-> "*" EventType | ||
|
||
@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
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
Oops, something went wrong.