Skip to content

Commit

Permalink
Merge 875c8eb into b28f834
Browse files Browse the repository at this point in the history
  • Loading branch information
ning-sy210 committed Oct 24, 2019
2 parents b28f834 + 875c8eb commit 87c2f51
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 4 deletions.
22 changes: 18 additions & 4 deletions docs/DeveloperGuide.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -258,12 +258,26 @@ image::CommitActivityDiagram.png[]
** Cons: Requires dealing with commands that have already been undone: We must remember to skip these commands. Violates Single Responsibility Principle and Separation of Concerns as `HistoryManager` now needs to do two different things.
// end::undoredo[]

// tag::dataencryption[]
=== [Proposed] Data Encryption
// tag::submit[]
=== [Proposed] Submit feature

_{Explain here how the data encryption feature will be implemented}_
The submit mechanism is facilitated by `UserInterface`.

// end::dataencryption[]
The Sequence Diagram given below is an example of a scenario in which the submit command is executed when the user enters "submit" into the `CommandBox` terminal.

image::submitSequenceDiagram.png[]

Step 1. The user enters "submit" into the `CommandBox`.

Step 2. The will call the `executeCommand()` method of the `CommandLogicManager` which will then call the `parseCommandText()` method of the `CommandParser`.

Step 3. The CommandParser then calls the constructor of the Command class to create a new Command object, which is then returned to the `CommandLogicManager`.

Step 4. CommandLogicManager then calls the `execute()` method of the newly created Command object.
The UI will then retrieve the user-written code from within the `Editor` as a String to be passed onto the `ProgramSubmissionLogicManager` to be compiled as a .class file for execution.

Step 5: After running the .class file, the output is then displayed to the user through the UI.
// end::submit[]

=== Evaluation of user program submissions
The evaluation of the user's programs is facilitated by the `solutions` package.
Expand Down
43 changes: 43 additions & 0 deletions docs/diagrams/submitSequenceDiagram.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
@startuml
!include style.puml

box Logic LOGIC_COLOR_T1
participant ":UI" as UserInterface LOGIC_COLOR
participant ":CommandLogicManager" as CommandLogicManager LOGIC_COLOR
participant ":CommandParser" as CommandParser LOGIC_COLOR
participant "c:Command" as Command LOGIC_COLOR
end box

[-> UserInterface : "submit"
activate UserInterface

UserInterface -> CommandLogicManager : executeCommand(submit)
activate CommandLogicManager

CommandLogicManager -> CommandParser : parseCommandText(submit)
activate CommandParser

create Command
CommandParser -> Command
activate Command

Command --> CommandParser
deactivate Command

CommandParser --> CommandLogicManager : c
deactivate AddressBookParser

CommandLogicManager -> Command : execute()
activate Command

Command --> CommandLogicManager : result
deactivate Command
Command -[hidden]-> CommandLogicManager : result
destroy Command

CommandLogicManager --> UserInterface
deactivate CommandLogicManager

[<-- UserInterface : display result
deactivate UserInterface
@enduml
Binary file added docs/images/submitSequenceDiagram.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 87c2f51

Please sign in to comment.