Woah! This page has a great deal of content... Give us a second to load it.

Software Architecture for iModel.js Apps

The software architecture of iModel.js was driven by the following goals:

  • Support iModel-based services running in any cloud or on premises
  • Support iModel-based web/desktop/mobile apps
  • Re-use business logic across web, desktop, and mobile apps
  • Re-use HTML GUI across web, desktop, and mobile apps

Backend Architecture Layers:

  • Application Backend (TypeScript)
  • iModel.js Backend Framework (TypeScript)
  • JavaScript Runtime with C++ Interoperability
  • iModel.js Native Libraries (C++)

Frontend Architecture Layers:

  • Application Frontend (TypeScript)
  • iModel.js Frontend Framework (TypeScript)
  • HTML GUI
  • Web Browser

Web

iModel.js Web App backends are Node.js applications. Node.js provides the V8 JavaScript Engine and the N-API for writing Node Addons in C++. This is how the iModel.js Native Libraries are exposed to the iModel.js backend framework. Portable application logic is written in TypeScript and calls TypeScript APIs exposed from the @bentley/imodeljs-backend package.

Notice that the backend architecture is identical between Agents and interactive Web Applications.

Web App frontends run in a web browser and use HTML GUI for presentation and APIs exposed from the @bentley/imodeljs-frontend package for Remote Procedure Calls (RPC) into functionality implemented on the backend.

The frontend --> backend communication is over HTTPS for interactive web applications.

SoftwareArchitecture-Web

> Write an interactive Web app

> Write a Web service

> Write a Web agent

Also see Logging and ActivityIds

Desktop

iModel.js desktop applications use the Electron Framework. The backend architecture is the same as with iModel.js Web Apps because Electron also uses Node.js. The only difference in the frontend architecture is that an embedded Chromium Browser replaces a standalone Web Browser.

The frontend --> backend communication is over Inter Process Communication (IPC) as provided by Electron.

SoftwareArchitecture-Desktop

> Write a desktop app

Mobile

iModel.js mobile applications use the JavaScript Engine and Web Browser GUI controls built into the Android SDK and iOS SDK.

The frontend --> backend communication is over function calls and messages between two separate JavaScript contexts.

SoftwareArchitecture-Mobile

> Write a mobile app

Comparison

The following diagram compares the architecture of web, desktop, and mobile applications and shows how the goals of portability and reuse are accomplished.

SoftwareArchitecture-Comparison

Last Updated: 14 November, 2018