diff --git a/docs/DeveloperGuide.md b/docs/DeveloperGuide.md index 00b1b0ea297..de76904a52d 100644 --- a/docs/DeveloperGuide.md +++ b/docs/DeveloperGuide.md @@ -118,19 +118,26 @@ 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) -**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.
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