Application Architecture

The four key players of an Equo application are:

  • Chromium for displaying web content.

  • Java for developing the backend application.

  • Equo SDK for enabling and managing realtime, bi-directional communication between Java and JavaScript, and vice versa. For intercepting, filtering, and handling requests and responses.

  • Java and JavaScript APIs for creating the application model and its parts smoothly, for working with the local filesystem and the operating system.

Developing a traditional Equo application is like building a web interface or building web pages, and seamlessly integrate them with a Java backend.

Main Processes

In an Equo application, the web pages are rendered in processes that are independent of the Java processes. That keeps the Java UI thread always responsive, as well as the web pages.

Communication between the web and the Java part is possible via the Comm API, this allows real-time bi-directional communication.

Structure of an Equo Application

Once the Equo application has been created with the CLI tool and the environment is ready, the next step is to start developing the application. You will need to import it in your favorite IDE.

Project Structure

An Equo application is just a Java application, so its project structure is the same as the one you will find in a traditional Java application.

.
├── pom.xml
└── src
    ├── main
    │   ├── resources
    │   │   └── index.html
    │   └── java
    │       └── samplename
    │           └── SampleNameApplication.java
    └── test
        └── java
            └── samplename
                └── SampleNameApplicationTest.java

The src/main/java folder contains the Java code of your application and the starting class which builds and starts an Equo Application. It also contains your event handlers classes - this classes capture the events that you define in your Java classes or in the JavaScript side of your application.

The src/main/resources folder contains all JavaScript, css, images, and html files of your application. It can actually include a complete web application. In the JavaScript files you can also define handlers which capture events that are triggered either from some other JavaScript files or in the Java side of your app. In the same files you can add code to modify your existing web application (this happens in the case of a web wrapper application). New UI elements can be easily added to or removed from the existing web application, and they will only be shown in your desktop Equo application.

The handlers mentioned before, which exist in both the Java and the JavaScript part of your application, are the endpoints of the JavaScript - Java communication. That’s because the communication between the web side and the Java side is completely managed by the Equo Communication component which is part of the Equo SDK. The Java-JavaScript interaction and how to develop these handlers are described in the Java and JavaScript Communication section.

The generated application also contains a property file which can be used to define the configuration of you application. For example, the application branding can be defined in this properties file.

Java and JavaScript APIs

The Java and the JavaScript APIs were designed to make it easier to build Equo applications. Most of the Java APIs have their counterpart in the JavaScript API, and vice versa. For example, you may create a Menu using the Java API or using the JavaScript API.