Data Sharing Between Apps
A Shared Context is a named object (holding a
value pairs) that stores cross application data. The context object can hold any desktop-wide or cross-application data. Any application can update a context or subscribe for update notifications (by using the name of the context). Apps can also react to context changes (by subscribing for context updates) or update the context at runtime.
The Shared Contexts API offers a simple and effective solution for sharing data between your applications. Imagine you have an application showing a list of clients and an application showing client portfolios. What you need, is your "Portfolio" app to show the portfolio of a specific client that the user has selected from the "Clients" app. You can easily achieve this in a few simple steps by using the Shared Contexts API:
- instruct the "Clients" app to publish updates to a context object, holding the
idof the currently selected client;
- instruct the "Portfolio" app to subscribe for updates of that same context object and specify how the "Portfolio" app should handle the received data in order to update its current state;