MCSH Libraries

Architecture and Design

This document introduces the architecture and design of the MCSH script libraries.


Table Of Contents


Script Libraries

The MCSH package provides a robust collection of library scripts that are utilized by MCSH tool scripts.

Rather than implementing one-off or walled-garden scripts, each area of required functionality has been systematically decomposed into a modular set of reusable components. Each library specifies and uses its own namespace, settings, and scripting interfaces.

MCSH Runtime Library

All of the tools and library scripts in the MCSH package are built upon a subset of MCSH libraries, and that subset of libraries is conceptually encapsulated (i.e. referred to) as the MCSH runtime library, or simply the runtime.

In the MCSH package, the tool runtime library is mcsh. Every MCSH tool executes the package runtime library script at the very top of their script source code file. The runtime proceeds to load every other core library, whether directly or indirectly (through transitive dependencies, as explained below). The resulting set of libraries provide the foundation interfaces and functionality required by all remaining scripts.

Core Script Libraries

The MCSH core libraries can be labeled as such using the following transitive definition: a library is part of the MCSH runtime if and only if it is included by the package runtime library or another core library. Dynamic dependencies are not considered part of the runtime library (e.g. backend libraries that implement an abstract interface), but the MCSH runtime does not have any such features at the moment (v0.12).

Feature Libraries

Technically, there are no differences between a core library (which is defined above as being included in the runtime) and a feature library (which, by definition, is not). Feature libraries are usually grouped into extension packs which collectively implement an entire domain of functionality.

Abstract Script Libraries

In MCSH, an abstract sript library provides a script interface that dynamically loads a backend library according to some rules. That backend library typically provides one among many possible implementations. For example, the Mandolin Creek User Interface library offers several different UI implementations: CLI, text windows, and graphical user interface. This technique minimizes the runtime footprint of the core and allows users to implement new functionality without needing to modify the core library code.

Library Documentation

The MCSH documentation formatting tools enable a library script to include inline comments that describe its public interface(s).

Every library MUST include full API documentation.


View the Developer Guide Index

View the Reference Manual Index


Generated on Wed Jun 28 07:39:21 PDT 2017 by mcsh d14 v0.20.0.