RemoteSkin is a server based UI with a swing renderer

RemoteSkin is an extension of nyssr.net. It is used to create distributed, server-side programs that provide a UI using a client-side renderer. The first interpretation of this technique uses Java Swing as a renderer.

Server-based programs

From the look and feel the programs behave like normal local Swing programs. However, the business logic is server-side. This, of course, gives advantages in distribution, since programs on the server can receive updates as often as desired without having to change the software on the client.

Distributed programs

nyssr.net also has another advantage: The server-side programs are distributed in the form of independent microservices. Thus, windows, dialogs, or parts of them can be outsourced to microservices that communicate directly with the renderer independently of the application. Again, the advantage is obvious: The UI elements can be designed, programmed and deployed by small teams independently of the application. This is a valuable advantage, especially for large applications. In addition, dialogs can be used by different applications, for example.

UI description

The description of a UI is done in JSON. This is used to describe widget sets, i.e. groups of widgets such as windows, buttons, list boxes, pull-down menus, etc. Each widget set is described in its own JSON file. There are different sections in the JSON file. A section contains the description of each widget (ID, attributes like background color, text etc.). Another section describes the hierarchy of widgets in the widget set (A is parent of B, C, F). Then there are template definitions to describe repeated attribute combinations with an ID. The descriptions of widget sets may contain links to further JSON files, e.g. for the context menus of individual widgets, etc. With this you can already describe a complete UI.

Manipulation of the widgets after display requires an API. We decided to use a flat function API and did not use an OO API. The reason for this is the planning of further renderers, some of which have completely different widgets. This does not fit with an API of objects that are sometimes supported and sometimes missing on different platforms. A flat API consists of functions like setText(WidgetId,Text).

mApi.setText(widgetId,
             "Hello!");

Client-side events are made available on the server side in the form of lambdas. A function API is used here as well.

mApi.addListener(widgetId, (IButtonPressedListener) this::onButtonCancel);

Client

On the client there is a client node with RemoteSkin plugins. Since a node is just a small Java program, it boots up lightning fast (about 200ms). Usually a login dialog is then shown, followed by an application selection (this is a matter of settings). Now, various applications can be started just as quickly. The performance results from the use of the fast nyssr.net protocol and the small amount of data that is transferred. For example, the server transfers just 14 Kbytes of data to start the user management application.