diff --git a/docs/DeveloperGuide.md b/docs/DeveloperGuide.md index d27c8cadf9c..369739df506 100644 --- a/docs/DeveloperGuide.md +++ b/docs/DeveloperGuide.md @@ -119,17 +119,17 @@ How the parsing works: - The `Model` component, -* stores the address book data i.e., all `Person` objects (which are contained in a `UniquePersonList` object). -* stores the currently 'selected' `Person` objects (e.g., results of a search query) as a separate _filtered_ list which is exposed to outsiders as an unmodifiable `ObservableList` that can be 'observed' e.g. the UI can be bound to this list so that the UI automatically updates when the data in the list change. +* stores the address book data i.e., all `Person` derivative objects (which are contained in a `UniquePersonList` object) and +* all `Appointment` objects (which are contained in a `UniqueAppointmentList` object) +* stores the currently 'selected' `Person` objects (e.g., results of a search query, either a `Patient` or `Doctor` instance) and `Appointment` object (e.g results of an query) as a separate _filtered_ list which is exposed to outsiders as an unmodifiable `ObservableList` and `ObservableList` that can be 'observed' e.g. the UI can be bound to this list so that the UI automatically updates when the data in the list change. * stores a `UserPref` object that represents the user’s preferences. This is exposed to the outside as a `ReadOnlyUserPref` objects. * does not depend on any of the other three components (as the `Model` represents data entities of the domain, they should make sense on their own without depending on other components) -
:information_source: **Note:** An alternative (arguably, a more OOP) model is given below. It has a `Tag` list in the `AddressBook`, which `Person` references. This allows `AddressBook` to only require one `Tag` object per unique tag, instead of each `Person` needing their own `Tag` objects.
+
:information_source: **Note:** For a clearer Class Diagram image, please refer to the handdrawn version below, it is exactly the same as the Class Diagram generated above, only drawn with straight lines for clarity and neatness.
- +
diff --git a/docs/diagrams/ModelClassDiagram.puml b/docs/diagrams/ModelClassDiagram.puml index 0de5673070d..ff937ab63c6 100644 --- a/docs/diagrams/ModelClassDiagram.puml +++ b/docs/diagrams/ModelClassDiagram.puml @@ -13,12 +13,23 @@ Class ModelManager Class UserPrefs Class UniquePersonList -Class Person -Class Address -Class Email +Class UniqueAppointmentList + +Class "{Abstract}\nPerson" as Person +Class Patient +Class Doctor + +Class Appointment +Class AppointmentDate +Class AppointmentID + +Class Type +Class NRIC Class Name +Class DoB Class Phone -Class Tag + +Class "<>\nType\n\nPatient\nDoctor" Class I #FFFFFF } @@ -36,19 +47,22 @@ ModelManager -right-> "1" UserPrefs UserPrefs .up.|> ReadOnlyUserPrefs AddressBook *--> "1" UniquePersonList -UniquePersonList --> "~* all" Person -Person *--> Name -Person *--> Phone -Person *--> Email -Person *--> Address -Person *--> "*" Tag +AddressBook *--> "1" UniqueAppointmentList +UniquePersonList ---> "~* all" Person +UniqueAppointmentList -down--> "~* all" Appointment +Person *---> Type +Person *---> NRIC +Person *---> Name +Person *---> DoB +Person *---> Phone -Person -[hidden]up--> I -UniquePersonList -[hidden]right-> I +Doctor .right.|> Person +Patient .--|> Person -Name -[hidden]right-> Phone -Phone -[hidden]right-> Address -Address -[hidden]right-> Email +Appointment *--> AppointmentDate +Appointment *--> AppointmentID +Appointment *--> "2(Patient & Doctor)" NRIC ModelManager --> "~* filtered" Person +ModelManager --> "~* filtered" Appointment @enduml diff --git a/docs/images/ModelClassDiagram.png b/docs/images/ModelClassDiagram.png index a19fb1b4ac8..b6c5d6436d5 100644 Binary files a/docs/images/ModelClassDiagram.png and b/docs/images/ModelClassDiagram.png differ diff --git a/docs/images/ModelClassDiagramHandDrawn.png b/docs/images/ModelClassDiagramHandDrawn.png new file mode 100644 index 00000000000..e3080c734a3 Binary files /dev/null and b/docs/images/ModelClassDiagramHandDrawn.png differ