Publish and Subscribe
Recently we have seen a push to add context awareness to applications. What do we mean by context awareness? We mean having your applications automatically respond to changes in the current operating environment. This can be as simple as your instant messaging client automatically setting your status to away when it detects that you are no longer actively using your computer. A more complex example of having the entire user interface of your device automatically reorganise itself to support your different work flows.
We are developing a cross platform publish and subscribe (P&S) API that can be used to publish and retrieve contextual information from the system. This allows the separation of the providers of contextual information from the consumers. In our above example a separate process calculates the users' activity state and publishes the result in the P&S hierarchy. Other processes, such as an IM client, subscribe to receive notifications about changes of this value and modify the application state accordingly.
The API supports the concept of multiple layers, meaning if there are multiple publish and subscribe systems on the platform they will be stacked on top of each other in priority order. Publishers can specify which layer they publish values to, while subscribers always retrieve values from the layer with the highest priority.
We have implementations for two different layers. On Windows platforms we have the Registry layer, which is based on volatile registry keys. It supports publishing and change notifications. On Unix platforms we have the Shared Memory layer, which is an in-house implementation based on local sockets and shared memory. Currently it only works on Unix platforms, however, we are working on making it cross-platform. Even though both of these layers use non-permanent storage there is nothing in the API that prohibits using permanent storage.
Disappointed that we don't provide a layer implementation for your favourite publish and subscribe system? No problem. Just provide your own. We actually encourage you to do so with our abstract layer class. Though we should warn you that we are not finished yet :). Layer implementations for other platforms are being worked on, in particular support for both the Central Repository and Publish'n'Subscribe systems on S60.
As always the code is now available in our public gitorious repository at http://qt.gitorious.org/qt-mobility/context.
Subscribe to our newsletter
Try Qt 6.6 Now!
Download the latest release here: www.qt.io/download.
Qt 6.6. is a feature release with focus on improving UX capabilities including responsive UI technology and the Qt Graph module.
Check out all our open positions here and follow us on Instagram to see what it's like to be #QtPeople.