Skip to content

Commit

Permalink
Update DG description and class diagrams
Browse files Browse the repository at this point in the history
  • Loading branch information
Kappaccinoh committed Mar 21, 2024
1 parent 8382de2 commit db477d9
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 20 deletions.
10 changes: 5 additions & 5 deletions docs/DeveloperGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,17 +119,17 @@ How the parsing works:

<img src="images/ModelClassDiagram.png" width="450" />


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<Person>` 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<Person>` and `ObservableList<Appointment>` 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)

<div markdown="span" class="alert alert-info">: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.<br>
<div markdown="span" class="alert alert-info">: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.<br>

<img src="images/BetterModelClassDiagram.png" width="450" />
<img src="images/ModelClassDiagramHandDrawn.png" width="450" />

</div>

Expand Down
44 changes: 29 additions & 15 deletions docs/diagrams/ModelClassDiagram.puml
Original file line number Diff line number Diff line change
Expand Up @@ -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 "<<enumeration>>\nType\n\nPatient\nDoctor"

Class I #FFFFFF
}
Expand All @@ -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
Binary file modified docs/images/ModelClassDiagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/ModelClassDiagramHandDrawn.png
Loading
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 db477d9

Please sign in to comment.