You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/DeveloperGuide.md
+36-1Lines changed: 36 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -178,6 +178,22 @@ A `Group` has:
178
178
179
179
and are stored in a single `UniqueGroupList` within an `AddressBook`.
180
180
181
+
#### Group Methods and Responsibilities
182
+
The `Group` class is responsible for managing its internal members and events, but it does not directly modify the global contact list or other global data. Instead, it ensures internal consistency within the group. Synchronisation with global data is handled by higher-level methods elsewhere in the application.
183
+
184
+
##### Internal lists and modification
185
+
The internal lists (persons and events) are not exposed except as read-only `ObservableList`s. The only way to modify the group’s state is through its methods such as: `addPerson`, `removePerson`, `addEvent`, and `removeEvent`.
186
+
187
+
##### Factory and update methods
188
+
*`Group.fromStorage`: A factory method used to create a new `Group` from input data (e.g., event list, person list, dashboard). This method is intended to be used only by specific methods and is not typically used for new groups, which should start with empty fields (except for the group name).
189
+
190
+
*`Group#withUpdatedName`: Returns a new `Group` with copied internal data but a different name. This method is used in commands like edit-group.
191
+
* This approach ensures that changes are explicit, preventing unintended side effects and making state management more predictable.
192
+
* While containers like lists or dashboards are copied to avoid modifying the original state, immutable elements are reused to optimize memory.
193
+
194
+
##### Why This Design?
195
+
This approach ensures that the `Group` class focuses solely on managing its own data, while global data (like contacts) is updated through methods in the `Model` layer. It keeps the system modular and reduces the risk of unintended side effects.
196
+
181
197
#### Key Components
182
198
##### Unique Lists
183
199
The implementation of `UniqueGroupList` and `UniqueEventList` follow the `UniquePersonList` pattern - that is, they are wrappers on an `ObservableList` which prevent the addition of duplicate entries.
@@ -201,7 +217,7 @@ To maintain the integrity of the application, the following invariants must be r
201
217
* Use Existing High-Level Methods (e.g., `Model#setPerson`): To modify a person’s details, always use the existing method `Model#setPerson`. This method ensures updates are properly synchronised across the model. Avoid manually calling lower-level methods like `UniquePersonList#setPerson`.
202
218
* Note: setPerson is a well-implemented method and serves as a good example for handling updates. While the codebase isn't fully consistent, use similar methods for other objects when available, or manually ensure synchronisation when necessary.
203
219
204
-
The immutability of Persons and Events allows for future implementation of features such as:
220
+
The immutability of Persons and Events simplifies the future implementation of features such as:
205
221
206
222
***State Saving:** Enabling features like undo/redo.
207
223
@@ -304,6 +320,25 @@ The following activity diagram summarizes what happens when a user executes a ne
304
320
## **Planned Enhancements**
305
321
Team size: 5
306
322
323
+
1.**Improve text wrapping behaviour in dashboard:**
324
+
The current dashboard GUI element does not properly wrap text for long member or event entries.
325
+
As a result, users must manually scroll horizontally to see the entire entry.
326
+
We plan to implement automatic text wrapping to improve the readability of these entries, ensuring that all content is visible without the need for horizontal scrolling.
327
+
2.**Fix vertical scrolling issue in Event list GUI (Group card):**
328
+
Currently, the Event list GUI sub-element in the Group card doesn’t handle long event strings properly.
329
+
When the event string is too long, text wrapping causes the list to scroll vertically, instead of expanding as expected.
330
+
We plan to fix this by ensuring the event list expands horizontally to accommodate long text without forcing vertical scrolling.
331
+
3.**Clarify event index error message:**
332
+
Currently, for commands using the event-index prefix, the error message does not specify if the event index is incorrect.
333
+
Instead, it generically states: "Index is not a non-zero unsigned integer." This could be confusing, especially when the command also uses a group index, as users wouldn’t know which index is causing the error.
334
+
We’ll update it to "Event index is not a non-zero unsigned integer" to clearly specify which index is invalid when both event and group indexes are used.
335
+
4.**Improve error message for index parsing in command preamble (Contact command):**
336
+
Currently, index parsing errors in the command preamble (for contact-related commands) result in a generic command usage message.
337
+
We will update this behavior to specify that the contact index is invalid (if non-empty) with the message "Contact index is not a non-zero unsigned integer", making the error message more informative.
338
+
5.**Improve error message for index parsing in command preamble (Group command):**
339
+
Currently, index parsing errors in the command preamble (for group-related commands) result in a generic command usage message.
340
+
We will update this behavior to specify that the group index is invalid (if non-empty) with the message "Group index is not a non-zero unsigned integer", making the error message more informative.
0 commit comments