Skip to content

Commit 3d7fd5b

Browse files
committed
Update readme
1 parent 2b19d18 commit 3d7fd5b

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

README.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -193,11 +193,18 @@ must be created: `ChildView` extends `ParentView`, `ChildViewModel` extends `Par
193193
Advantages of this approach:
194194

195195
* Strict Separation. Using a `Component` together with a `Mediator` enforces a clear separation of layers according to
196-
MVVM and simplifies testing.
196+
MVVM and simplifies testing. The `Mediator` interface defines how a `ViewModel` can initiate the addition or removal of
197+
a component without violating MVVM principles. It provides a controlled, testable channel for UI composition that
198+
respects the pattern's constraints.
197199
* Clean Architecture. The `Component` centralizes all logic related to managing child components, keeping the
198-
`View` and `ViewModel` free from responsibilities that do not belong to them.
199-
* MVVM Compliance. The `Mediator` interface defines how a `ViewModel` can initiate the addition or removal of a
200-
component without violating MVVM principles.
200+
`View` and `ViewModel` free from responsibilities that do not belong to them. This prevents `View` and `ViewModel` from
201+
becoming bloated with lifecycle management or compositional logic. In addition, the `Component` serves as a single
202+
source of truth for child component references. This eliminates duplication where `View` would store child `View`
203+
references and `ViewModel` would store child `ViewModel` references. Instead, the `Component` manages the complete
204+
child graph while exposing only appropriate references to each layer.
205+
* Explicit Component-Level Operations. When `View` or `ViewModel` needs to interact at the component level,
206+
it does so explicitly through `getComponent()` or `getMediator()` calls. This creates clear architectural boundaries
207+
and makes it immediately visible when code crosses from view/view-model concerns into component management concerns.
201208

202209
In addition to the four classes, a component may include a `ComponentHistory`. The `ComponentHistory` enables the
203210
preservation of the component’s state across its lifecycle. Data exchange occurs exclusively between the

0 commit comments

Comments
 (0)