You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/DeveloperGuide.md
+27Lines changed: 27 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -300,6 +300,33 @@ The sequence diagram below closely describes the interaction between the various
300
300
301
301
302
302
303
+
304
+
### Query `doctor` and `patient`
305
+
306
+
Queries a 'doctor' or 'patient' entry by indicating their name or a substring of their name.
307
+
This command is implemented through the `QueryDoctor` and `QueryPatient` classes which extend the `Command` class.
308
+
309
+
* Step 1. User enters an `querypatient` or `querydoctor` command.
310
+
* Step 2. The `AddressBookParser` will call `parseCommand` on the user's input string and return an instance of `queryDoctorCommandParser` or `queryPatientCommandParser`.
311
+
* Step 3. The `parse` command in `queryDoctorCommandParser` or `queryPatientCommandParser` calls `ParserUtil` to create instances of objects for each of the fields.
312
+
* If there are any missing fields, a `CommandException` is thrown.
313
+
* If input arguments does not match contraints for the fields, a `IllegalArgumentException` is thrown.
314
+
315
+
The activity diagram below demonstrates this error handling process in more detail.
* Step 4. The `parse` command in `queryDoctorCommandParser` or `queryDoctorCommandParser` return an instance of `queryPatientCommand` or `queryPatientCommand` respectively.
320
+
* Step 5. The `LogicManager` calls the `execute` method in `queryDoctorCommandParser` or `queryDoctorCommandParser`.
321
+
* Step 6. The `execute` method in `queryDoctorCommandParser` or `queryDoctorCommandParser` executes and calls `updateFilteredPersonList` in model to get a filtered list of `Doctor` or `Patient`.
322
+
* Step 7. Success message gets printed onto the results display to notify user and the list of matching results is produced.
323
+
324
+
325
+
Why is this implemented this way?
326
+
1. Making both `Doctor` and `Patient` class extend the `Person` class makes it easier to execute query operations.
327
+
2.`Doctor` and `Patient` all exhibit similar qualities, and thus can inherit from the `Person` superclass.
0 commit comments