Inspecting remote objects using Remote Phlow
This page details how we handle the inspection of remote objects using Remote Phlow.
Remote Phlow is meant to support inspecting objects in different programming languages.
Proxies and views
Through Remote Phlow we attach views to proxy objects by defining the views on the actual remote objects. Hence, the remote environment needs to have an implementation of Remote Phlow that knows how to create the views on the remote side.
When inspecting a proxy to a remote object, the inspector builds the list of views that the object defines on the remote side, serializes those views, and brings them locally. Views can then communicate with the remote object to bring more data as needed.
A proxy object defines a composite tool when inspected:
- one tool shows the views specific to the actual object (the Remote tool). This list contains object-specific views attach both remotely or locally to the proxy object;
- another tool shows the views specific to the implementation of the proxy object (the Proxy tool)
As an example,
^ GtRemoteInspectionSimulation openOn: GtRemotePhlowDeclarativeTestInspectable new.
creates a simulation, that shows how inspecting a local object would look like in a remote GT image.
To handle remote views, when inspecting a remote object, Remote Phlow provides a dedicated inspector object on the remote side that wraps the target remote object and knows how to return information related to its views.
The local inspector creates then a proxy to that dedicated inspector object and only communicates with it, insted of the initial proxy.
In case the remote system is Glamorous Toolkit, the remote inspector proxy will be an instance of type
Object subclass: #GtRemotePhlowViewedObject
instanceVariableNames: 'object declarativeViewsBySelector'
. An example of how views are added to the proxy object is the trait
Trait named: #TGtRemoteLanguageProxyViewsAttachment
The inspector proxy returns views as specifications. These are subclasses of
Object subclass: #GtPhlowViewSpecification
instanceVariableNames: 'phlowDataSource methodSelector title priority dataTransport'
. Each specification knows how to create the corresponding local phlow view by overriding.
"Specifications should implement this method to create a local phlow view from the remote data."
Having a specification format for views independent of how phlow view objects are implemented in Glamorous Toolkit, means that the remote system can be in a different language, like Python or JavaSscript, as long as the specification format for view is the same.