Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Model and UI diagrams in DG #266

Merged
merged 9 commits into from
Apr 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/DeveloperGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ The `Model` component,
* 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 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)

* stores the meeting book data i.e., all `Meeting` objects (which are contained in a `UniqueMeetingList` object) in each `Person` object.
<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 `StaffBook`, which `Person` references. This allows `StaffBook` to only require one `Tag` object per unique tag, instead of each `Person` needing their own `Tag` objects.<br>

<img src="images/BetterModelClassDiagram.png" width="450" />
Expand Down
1 change: 1 addition & 0 deletions docs/diagrams/BetterModelClassDiagram.puml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@ Person *--> Module
Person *--> Faculty
Person *--> Venue
Person *--> "*" Availability
Person *--> Favourite
@enduml
21 changes: 18 additions & 3 deletions docs/diagrams/ModelClassDiagram.puml
tsulim marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,20 @@
skinparam arrowThickness 1.1
skinparam arrowColor MODEL_COLOR
skinparam classBackgroundColor MODEL_COLOR
skinparam Padding 3

Package Model as ModelPackage <<Rectangle>>{
Class "<<interface>>\nReadOnlyStaffBook" as ReadOnlyStaffBook
Class "<<interface>>\nReadOnlyMeetingBook" as ReadOnlyMeetingBook
Class "<<interface>>\nReadOnlyUserPrefs" as ReadOnlyUserPrefs
Class "<<interface>>\nModel" as Model
Class StaffBook
Class ModelManager
Class MeetingBook
Class MeetingManager
Class UserPrefs

Class UniqueMeetingList
Class UniquePersonList
Class Person
Class Name
Expand All @@ -22,6 +27,7 @@ Class Faculty
Class Venue
Class Tag
Class Availability
Class Favourite
Class Meeting

Class I #FFFFFF
Expand All @@ -30,15 +36,20 @@ Class I #FFFFFF
Class HiddenOutside #FFFFFF
HiddenOutside ..> Model

StaffBook .up.|> ReadOnlyStaffBook


StaffBook .up.|> ReadOnlyStaffBook
ModelManager .up.|> Model
Model .right.> ReadOnlyUserPrefs
Model .left.> ReadOnlyStaffBook
ModelManager -left-> "1" StaffBook
ModelManager -right-> "1" UserPrefs
UserPrefs .up.|> ReadOnlyUserPrefs

MeetingManager -right-> "1" MeetingBook
MeetingBook .up.|> ReadOnlyMeetingBook
MeetingBook -down->"1" UniqueMeetingList

StaffBook *--> "1" UniquePersonList
UniquePersonList --> "~* all" Person
Person *--> Name
Expand All @@ -49,7 +60,9 @@ Person *--> Faculty
Person *--> Venue
Person *--> "*" Tag
Person *--> "*" Availability
Person *--> "*" Meeting
Person *--> "1" MeetingManager
UniqueMeetingList *--> "*" Meeting
Person *--> Favourite

Person -[hidden]up--> I
UniquePersonList -[hidden]right-> I
Expand All @@ -61,7 +74,9 @@ Module -[hidden]right-> Faculty
Faculty -[hidden]right-> Venue
Venue -[hidden]right-> Tag
Tag -[hidden]right-> Availability
Availability -[hidden]right-> Meeting
Availability -[hidden]right-> Favourite

Person -[hidden]right> MeetingManager

ModelManager --> "~* filtered" Person
@enduml
9 changes: 7 additions & 2 deletions docs/diagrams/UiClassDiagram.puml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Class MainWindow
Class HelpWindow
Class ResultDisplay
Class PersonListPanel
Class NameCard
Class PersonCard
Class StatusBarFooter
Class CommandBox
Expand All @@ -35,22 +36,26 @@ MainWindow *-down-> "1" ResultDisplay
MainWindow *-down-> "1" PersonListPanel
MainWindow *-down-> "1" StatusBarFooter
MainWindow --> "0..1" HelpWindow
MainWindow *-down-> "1" PersonCard

PersonListPanel -down-> "*" PersonCard
PersonListPanel -down-> "*" NameCard

MainWindow -left-|> UiPart

ResultDisplay --|> UiPart
CommandBox --|> UiPart
PersonListPanel --|> UiPart
PersonCard --|> UiPart
NameCard --|> UiPart
StatusBarFooter --|> UiPart
HelpWindow --|> UiPart
PersonCard --|> UiPart

NameCard ..> Model
PersonCard ..> Model
UiManager -right-> Logic
MainWindow -left-> Logic

PersonCard -[hidden]left- PersonListPanel
PersonListPanel -[hidden]left- HelpWindow
HelpWindow -[hidden]left- CommandBox
CommandBox -[hidden]left- ResultDisplay
Expand Down
Binary file modified docs/images/BetterModelClassDiagram.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 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 modified docs/images/UiClassDiagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading