Hello everyone,
I would like to share Client Variables between multiple Reactive Web Apps.
The OutSystems documentation recommends exposing a Block to share a Client Variable between applications:
https://success.outsystems.com/documentation/11/building_apps/data_management/share_a_client_variable_between_apps/
However, according to OutSystems architecture best practices, side references between applications should generally be avoided.
If an End-User App directly references a Block from another End-User App, it creates a strong dependency and may also introduce a side reference.
These two recommendations seem to conflict, so I am not sure which approach should be followed.
What is the recommended architecture for sharing Client Variables between Reactive Web Apps without creating undesirable side dependencies?
Should the shared Block and Client Variable be placed in a separate Foundation or Core module, or is there a better pattern for this use case?
Thank you.
You’re right to notice the apparent conflict:
The doc example is intentionally simple to show how to share a Client Variable technically, not how to architect a real solution. For production systems, you should still follow the Architecture Canvas rules.
Instead of App A exposing a Block that App B consumes, create a separate Reactive UI module in the Core (CW) layer that:
Client Variables
This way:
In practice:
MyProject_CW_SessionContext
CurrentUserRole
TenantContext
OnInitialize
InitializeContext
All consuming apps:
Note: Even though the official doc example puts the Block in “App A”, you’re free (and encouraged) to put it in a Core module instead. The underlying mechanism is the same; only the layering differs.
Before going to shared client state, consider whether you actually need to:
These approaches:
What is the recommended architecture to share Client Variables between Reactive apps without bad side dependencies?
Should the shared Block and Client Variable be in a Foundation/Core module?
If you describe what kind of data you’re sharing (user context, preferences, filters, etc.), I can suggest whether Client Variables in a Core module are the best fit or if a server-side pattern would be cleaner.