Skip to content

Commit 0962bf3

Browse files
committed
Update grou model
1 parent d490aa7 commit 0962bf3

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

docs/DeveloperGuide.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,8 @@ The internal lists (persons and events) are not exposed except as read-only `Obs
188188
* `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).
189189

190190
* `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.
191193

192194
##### Why This Design?
193195
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.

0 commit comments

Comments
 (0)