Skip to content

Commit 072d00d

Browse files
committed
add Design-Commands section to DG
1 parent 12889b4 commit 072d00d

File tree

3 files changed

+27
-0
lines changed

3 files changed

+27
-0
lines changed

docs/DeveloperGuide.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,33 @@
1010

1111
### Commands
1212

13+
![DG-Design Commands UML](./images-dg/DG-Design-Commands.png?raw=true "Commands UML Class Diagram")
14+
15+
API: [seedu.ecardnomics/command](https://github.com/AY2021S1-CS2113-T14-2/tp/tree/master/src/main/java/seedu/ecardnomics/command)
16+
17+
Commands are primarily classified into two categories, `NormalCommand` and `DeckCommand`, corresponding to the
18+
application's Normal and Deck Modes, respectively. `NormalCommand` and `DeckCommand` are both abstract children derived
19+
from the overarching abstract class `Command`. The basis `Command` class is defined as such:
20+
21+
```java
22+
public abstract class Command {
23+
public abstract void execute();
24+
}
25+
```
26+
27+
It only requires that all derived children implement the `execute()` method. The only two classes not belonging to
28+
either Normal or Deck Mode are `ExitCommand` and `VoidCommand`. The former is so that users can call the command
29+
`exit` from anywhere in the application, while the latter is a catch-all "command" for all erroneous commands a
30+
user enters.
31+
32+
`NormalParser` and `DeckParser` play important roles in execution of specific commands, e.g. `CreateCommand`, because
33+
they define methods that check and ensure the conformity of user input to the commands' expected input. Below is a
34+
sequence diagram showcasing this interaction, for execution of a `CreateCommand`, e.g. `create
35+
microeconomics`:
36+
37+
![DG-Design CreateCommand Sequence UML](./images-dg/DG-Design-Sequence-Diagram.png?raw=true "CreateCommand UML
38+
Sequence Diagram")
39+
1340
### Storage
1441

1542
## Implementation - Basic
173 KB
Loading
66.2 KB
Loading

0 commit comments

Comments
 (0)