Skip to content

Commit

Permalink
Add puml files for tutorial class diagrams
Browse files Browse the repository at this point in the history
Two class diagrams in 'Add Remark Command' tutorial don't
have corresponding .puml files. Furthermore, the diagrams
have some errors.

Let's correct the errors, and also add the missing .puml files.

Also, let's rename the files to more suitable names.
  • Loading branch information
damithc committed Sep 11, 2023
1 parent 07778d9 commit 517b785
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 2 deletions.
14 changes: 14 additions & 0 deletions docs/diagrams/add-remark/ParserClass.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
@startuml
hide circle
skinparam classAttributeIconSize 0

Class "<<interface>>\nParser" as Parser
Class RemarkCommandParser {
+parse(): RemarkCommand
}
Class ParserException

RemarkCommandParser .up.|> Parser
Parser .right.> ParserException: throws >
RemarkCommandParser .right.> ParserException: throws >
@enduml
19 changes: 19 additions & 0 deletions docs/diagrams/add-remark/RemarkClass.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
@startuml
hide circle
skinparam classAttributeIconSize 0

Class "{abstract}\nCommand" as Command {
+execute(Model): CommandResult
}
Class RemarkCommand {
+COMMAND_WORD: String
+MESSAGE_USAGE: String
+MESSAGE_NOT_IMPLEMENTED_YET: String
+execute(Model): CommandResult
}
Class CommandException

RemarkCommand -up-|> Command
Command ..> CommandException: throws >
RemarkCommand .right.> CommandException: throws >
@enduml
Binary file removed docs/images/add-remark/CommandInterface.png
Binary file not shown.
Binary file removed docs/images/add-remark/ParserInterface.png
Binary file not shown.
Binary file added docs/images/add-remark/RemarkCommandClass.png
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.
4 changes: 2 additions & 2 deletions docs/tutorials/AddRemark.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ Run `Main#main` and try out your new `RemarkCommand`. If everything went well, y

While we have successfully printed a message to `ResultDisplay`, the command does not do what it is supposed to do. Let’s change the command to throw a `CommandException` to accurately reflect that our command is still a work in progress.

![The relationship between RemarkCommand and Command](../images/add-remark/CommandInterface.png)
![The relationship between RemarkCommand and Command](../images/add-remark/RemarkCommandClass.png)

Following the convention in other commands, we add relevant messages as constants and use them.

Expand Down Expand Up @@ -142,7 +142,7 @@ Now let’s move on to writing a parser that will extract the index and remark f

Create a `RemarkCommandParser` class in the `seedu.address.logic.parser` package. The class must extend the `Parser` interface.

![The relationship between Parser and RemarkCommandParser](../images/add-remark/ParserInterface.png)
![The relationship between Parser and RemarkCommandParser](../images/add-remark/RemarkCommandParserClass.png)

Thankfully, `ArgumentTokenizer#tokenize()` makes it trivial to parse user input. Let’s take a look at the JavaDoc provided for the function to understand what it does.

Expand Down

0 comments on commit 517b785

Please sign in to comment.