Skip to content

Commit f4231bb

Browse files
authored
Update readme
1 parent 3d7fd5b commit f4231bb

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

README.md

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -131,15 +131,18 @@ demonstrate.
131131
### Component Structure <a name="component-structure"></a>
132132

133133
A component always consists of at least four classes: a `Component`, a `ComponentView`, a `ComponentViewModel`
134-
and `ComponentMediator`. A natural question might arise: why is there no `Model` in the component, given that
135-
the pattern is called MVVM?
136-
137-
Firstly, a component is a building block for constructing a user interface, which might not be related to the
138-
application's business logic at all. Secondly, the `Model` exists independently of the UI and should have no knowledge
139-
of the component's existence. Thirdly, MVVM is fundamentally about the separation of responsibilities rather than
140-
the mandatory presence of all three layers in every element. In other words, a component does not violate MVVM
141-
principles simply because it lacks a `Model`; it remains compliant as long as the `View` and `ViewModel` maintain a
142-
clear separation of concerns and communicate exclusively through data binding and observable properties.
134+
and `ComponentMediator`:
135+
136+
<img width="1013" height="460" alt="Screenshot from 2025-12-19 17-19-38" src="https://github.com/user-attachments/assets/00bbbb5e-9092-4752-8954-c9b8da184ca3" />
137+
138+
A natural question might arise: why is there no `Model` in the component, given that
139+
the pattern is called MVVM? Firstly, a component is a building block for constructing a user interface, which might
140+
not be related to the application's business logic at all. Secondly, the `Model` exists independently of the UI and
141+
should have no knowledge of the component's existence. Thirdly, MVVM is fundamentally about the separation of
142+
responsibilities rather than the mandatory presence of all three layers in every element. In other words, a component
143+
does not violate MVVM principles simply because it lacks a `Model`; it remains compliant as long as the `View` and
144+
`ViewModel` maintain a clear separation of concerns and communicate exclusively through data binding and observable
145+
properties.
143146

144147
The `ComponentView` and `ComponentViewModel` classes correspond to the `View` and `ViewModel` in the MVVM pattern and
145148
are relatively straightforward. The `Component` and `ComponentMediator` classes, on the other hand, address the

0 commit comments

Comments
 (0)