Skip to content

Commit 38eb5d0

Browse files
committed
Update javadoc and readme for Mediator
1 parent b163a0e commit 38eb5d0

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ provided API, such as dialogs or popup windows. This limitation exists because t
124124
elements within its own scope and awareness.
125125

126126
In addition to the `ComponentViewModel` and `ComponentView`, a component always has a `ComponentDescriptor` and may
127-
include two optional classes: `ComponentHistory` and `ComponentBridge`.
127+
include two optional classes: `ComponentMediator` and `ComponentHistory`.
128128

129129
The `ComponentDescriptor` represents the internal metadata and platform-level state of a component. The descriptor
130130
acts as a technical identity card, containing all framework-related information while keeping it completely separate

mvvm4fx-core/src/main/java/com/techsenger/mvvm4fx/core/ComponentMediator.java

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,18 @@
1717
package com.techsenger.mvvm4fx.core;
1818

1919
/**
20-
* This interface is used by the ParentViewModel to add or remove child components (such as tabs, panes, dialogs, etc.).
21-
* It provides a bridge for managing these components. The component bridge is created in the View and has a reference
22-
* to the View, but it does not provide a direct reference to the ViewModel.
20+
* Defines a mediator interface used by the {@code ParentViewModel} to perform view-related operations,
21+
* such as adding or removing child components (tabs, panes, dialogs, etc.).
2322
*
24-
* <p>For example, to show a dialog, the bridge implementation can include a method like the following:</p>
23+
* <p>The {@code ComponentMediator} acts as an intermediary between the {@code ComponentViewModel} and its corresponding
24+
* {@code ComponentView}. It is created within the View layer and maintains a reference to the View, allowing the
25+
* ViewModel to request UI actions without holding a direct reference to the View itself.
26+
*
27+
* <p>For example, to display a dialog, the mediator implementation might define a method such as:
2528
*
2629
* <pre>
2730
* void openDialog(DialogViewModel dialogViewModel) {
28-
* //alternatively, this logic can be handled within the View itself
31+
* // Alternatively, this logic can be encapsulated inside the View itself.
2932
* DialogView dialogView = new DialogView(dialogViewModel);
3033
* dialogView.initialize();
3134
* getView().openDialog(dialogView);

0 commit comments

Comments
 (0)