I’m exploring Vaadin Signals in a Flow application and I want to make sure I follow best practices regarding ownership, lifecycle, and propagation. I understand that Signals can be used to inform the UI about backend state changes, but I’m unsure about the most appropriate way to manage and share them between UI classes and “Service” classes.
- Should I create global application-wide signals via
SignalFactory.IN_MEMORY_SHAREDin the UI and the Backend service, or is it better to manage signals as Spring beans? Or maybe member variables in Service classes with a getter for the UI? - For signals that are UI/session-specific, is it recommended to use
@UIScopeSpring beans, or pass them via constructors to the views/components? - Who should “own” a signal — the backend service that updates it, or the frontend/UI component that binds to it?
- Are there recommended patterns for when a signal represents shared state vs local component state?
I’d love to hear how others structure their Signals in a Vaadin Flow project.
Thanks in advance!