From d24302b90b0d625ac9d4d15398c3a1e8671276c3 Mon Sep 17 00:00:00 2001 From: zaidansani Date: Wed, 16 Oct 2024 00:31:45 +0800 Subject: [PATCH 1/2] Update Model section of developer guide Reflected new AppointmentBook model, as well as changes to existing Person model. --- docs/DeveloperGuide.md | 15 +++++++--- docs/diagrams/BetterModelClassDiagram.puml | 6 +++- docs/diagrams/ModelClassDiagram.puml | 32 +++++++++++++++++----- 3 files changed, 41 insertions(+), 12 deletions(-) diff --git a/docs/DeveloperGuide.md b/docs/DeveloperGuide.md index 00b1b0ea297..c8d245f72a2 100644 --- a/docs/DeveloperGuide.md +++ b/docs/DeveloperGuide.md @@ -118,13 +118,20 @@ How the parsing works: ### Model component **API** : [`Model.java`](https://github.com/se-edu/addressbook-level3/tree/master/src/main/java/seedu/address/model/Model.java) - - + 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. +* with regards to `Person` objects: + * stores the details of a person in a `PersonDescriptor` object + * stores the `PersonDescriptor` object with a `personId` in the `Person` class. + * 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. +* with regards to `Appointment` objects: + * stores the details of an appointment in a `AppointmentDescriptor` object + * stores the `AppointmentDescriptor` object with a `appointmentId` in the `Appointment` class. + * stores the address book data i.e., all `Appointment` objects (which are contained in a `UniqueAppointmentList` object). + * stores the currently 'selected' `Appointment` 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 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) diff --git a/docs/diagrams/BetterModelClassDiagram.puml b/docs/diagrams/BetterModelClassDiagram.puml index 598474a5c82..99c2328177c 100644 --- a/docs/diagrams/BetterModelClassDiagram.puml +++ b/docs/diagrams/BetterModelClassDiagram.puml @@ -4,10 +4,14 @@ skinparam arrowThickness 1.1 skinparam arrowColor MODEL_COLOR skinparam classBackgroundColor MODEL_COLOR +AppointmentBook *-left-> "1" UniqueAppointmentList +UniqueAppointmentList *-down-> "1" Appointment +Appointment *-left-> "1" Person + AddressBook *-right-> "1" UniquePersonList AddressBook *-right-> "1" UniqueTagList UniqueTagList -[hidden]down- UniquePersonList -UniqueTagList -[hidden]down- UniquePersonList +UniqueTagList -[hidden]down- UniqueTagList UniqueTagList -right-> "*" Tag UniquePersonList -right-> Person diff --git a/docs/diagrams/ModelClassDiagram.puml b/docs/diagrams/ModelClassDiagram.puml index 0de5673070d..0ea8ced614a 100644 --- a/docs/diagrams/ModelClassDiagram.puml +++ b/docs/diagrams/ModelClassDiagram.puml @@ -6,20 +6,27 @@ skinparam classBackgroundColor MODEL_COLOR Package Model as ModelPackage <>{ Class "<>\nReadOnlyAddressBook" as ReadOnlyAddressBook +Class "<>\nReadOnlyAppointmentBook" as ReadOnlyAppointmentBook Class "<>\nReadOnlyUserPrefs" as ReadOnlyUserPrefs Class "<>\nModel" as Model Class AddressBook +Class AppointmentBook Class ModelManager Class UserPrefs Class UniquePersonList Class Person +Class PersonDescriptor Class Address Class Email Class Name Class Phone Class Tag +Class UniqueAppointmentList +Class Appointment +Class AppointmentDescriptor + Class I #FFFFFF } @@ -29,20 +36,30 @@ HiddenOutside ..> Model AddressBook .up.|> ReadOnlyAddressBook ModelManager .up.|> Model -Model .right.> ReadOnlyUserPrefs +Model .down.> ReadOnlyUserPrefs Model .left.> ReadOnlyAddressBook +Model .right.> ReadOnlyAppointmentBook ModelManager -left-> "1" AddressBook -ModelManager -right-> "1" UserPrefs +ModelManager -down-> "1" UserPrefs +ModelManager -right-> "1" AppointmentBook UserPrefs .up.|> ReadOnlyUserPrefs AddressBook *--> "1" UniquePersonList UniquePersonList --> "~* all" Person -Person *--> Name -Person *--> Phone -Person *--> Email -Person *--> Address -Person *--> "*" Tag +Person *--> "1" PersonDescriptor +PersonDescriptor *--> Name +PersonDescriptor *--> Phone +PersonDescriptor *--> Email +PersonDescriptor *--> Address +PersonDescriptor *--> "*" Tag + +AppointmentBook *--> "1" UniqueAppointmentList +UniqueAppointmentList --> "~* all" Appointment +Appointment *--> "1" AppointmentDescriptor +AppointmentDescriptor *--> Person +Appointment -[hidden]down--> I +PersonDescriptor -[hidden]up--> I Person -[hidden]up--> I UniquePersonList -[hidden]right-> I @@ -51,4 +68,5 @@ Phone -[hidden]right-> Address Address -[hidden]right-> Email ModelManager --> "~* filtered" Person +ModelManager --> "~* filtered" Appointment @enduml From 1c94a834ca5f4671fbc60495625943bf8ced1f35 Mon Sep 17 00:00:00 2001 From: zaidansani Date: Fri, 18 Oct 2024 14:02:10 +0800 Subject: [PATCH 2/2] Update description of OOP model --- docs/DeveloperGuide.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/DeveloperGuide.md b/docs/DeveloperGuide.md index c8d245f72a2..de76904a52d 100644 --- a/docs/DeveloperGuide.md +++ b/docs/DeveloperGuide.md @@ -137,7 +137,7 @@ The `Model` component, -**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.
+**Note:** An alternative (arguably, a more OOP) model is given below. It has a `Tag` list (the `UniqueTagList`) 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. Similarly, the `Appointment` objects are shown as such as well.