Transferring Remote Views

As detailed in Specifications and Views in Remote Phlow, implementations of The LanguageLink protocol can transmit view specifications to Glamorous Toolkit.

Many implementations solve this by not just returning a bare value in the value of the ENQUEUE command, but instead an object with an ID (in Python, the constructed object is a PBProxyObject PBObject subclass: #PBProxyObject instanceVariableNames: 'pythonClass application' classVariableNames: '' package: 'PythonBridge-Core' ). These IDs can then be used to establish a way for both sides of the connection to talk about the same object and query it.

In the Python Bridge, we can then construct a “Viewed Object” using PBProxyObject>>#getRemoteInspectorProxy getRemoteInspectorProxy "Answer a GtViewedProxy on the receiver" | gtPackage | gtPackage := self application gtPackage => #gt. ^ self application newCommandFactory << gtPackage import; << (gtPackage => #GtViewedObject callWith: { self }); sendAndWait (other implementations follow this pattern). This GtPythonRemotePhlowViewedObject PBProxyObject subclass: #GtPythonRemotePhlowViewedObject instanceVariableNames: '' classVariableNames: '' package: 'Gt4PythonBridge-Core' is a special remote object that holds the inspected object’s view specifications (GtPythonRemotePhlowViewedObject>>#getViewsDeclarations getViewsDeclarations ^ self newCommandFactory << (self => #getViewsDeclarations) call; sendAndWait ).

From here, we can construct views and present them in their own tool (PBProxyObject>>#gtRemoteSideInspectorTool gtRemoteSideInspectorTool ^ GtInspectorTool forObject: self viewSelector: #gtRemoteInspectorContentFor: ).

While every known implementation follows slightly different patterns, many of the involved objects can be shared if the protocol is followed.