System Architecture

The components and their relations

The Bench system consists of a file system layout, binaries for Core Library, Command Line Interface, and Dashboard, a couple of PowerShell/CMD scripts, the app libraries, and the configuration. Since the architecture is constantly evolving until Bench hits the version 1.0 this article contains only a brief description of the current state.


Architecture Overview

File System Layout

Bench uses a file system layout with three folder groups. For a detailed description of the file structure see: File Structure Reference.

Bench System

The first group contains binaries, scripts and resources of the Bench system itself. This group is replaced in case of an upgrade.

auto, res

User Configuration and Data

The second group contains the user configuration and user data. This group is not changed by any Bench operation like upgrade, app installation, or app removal.

config, home, projects, archive, log,

Temporary Files and App Resources

And the third group contains the installed apps and temporary data. This group can be deleted without any actual data loss, because it is rebuild by Bench during the app installation automatically.

cache, lib, launcher, tmp, env.cmd, BenchDashboard.lnk

Bench Core Binary

The most logic in the Bench system is implemented in the BenchLib.dll wich is also called the Bench Core binary. It is a Microsoft .NET assembly with a public API. It supports loading the different layers of the Bench configuration, downloading, installing, updating, and removing apps according to the loaded configuration.

Command Line Interface

Bench provides a command line interface via the bench.exe. It allows to manage and interact with the Bench environment. The Bench CLI depends on the Bench Core.

Bench Dashboard

The dashboard is a program with a graphical user interface which makes the various features of the Bench system available in a mouse-friendly way. The Bench Dashboard depends on the Bench Core.

Power-Shell Scripts

Some features are implemented by PowerShell scripts. They load the BenchLib.dll and call its public methods.

Two important features, implemented by PowerShell scripts, are the execution adornment and the registry isolation. In both cases, an execution proxy in lib\_proxies calls Run-Adorned.ps1 to execute pre- and post-execution scripts. The registry isolation is implemented as a couple of functions in reg.lib.ps1.

CMD Scripts

There are three CMD batch scripts for launching a shell in the Bench environment: bench-cmd.cmd, bench-ps.cmd, and bench-bash.cmd. These scripts depend on the env.cmd in the Bench root directory for loading the environment variables.

App Libraries

The knowledge about app resources and thier installation strategy is stored in app libraries. An app library contains an index with the app properties and optionally PowerShell scripts for customization of setup steps and execution adornment.

App libraries are hosted independently and are referenced in the Bench configuration. The user configuration is also an app library. It is called the user app library, and contains app descriptions written by the user.

Configuration Levels

Bench supports three levels of configuration:

  1. The default configuration, which comes with the Bench installation and should not be edited.
  2. The user configuration, which can be versioned and shared via Git.
  3. And the site configuration, which can be stored outside of the Bench environment and can take influence on multiple Bench environments.

Configuration files are written in Markdown list syntax and support a number of configuration properties.