Modelverse components
=====================

The Modelverse consists of three individual projects, which are linked together to construct the Modelverse.
Each of these projects stands alone and has its own concerns.
A socket interface to communicate with the other components is provided.
By using sockets, it becomes possible to switch everything about the implementation, even the implementation language, without endangering interoperability.

The three projects are:

1. Modelverse State
2. Modelverse Kernel
3. Modelverse Interface

.. image:: img/overview.svg

Modelverse State (MvS)
----------------------

The Modelverse State implements the data storage features of the Modelverse.
To the Modelverse State, all data needs to be representable as a graph, which it will manipulate.

All basic, and some composite, operations are implemented on this graph, such as creating nodes and edges, reading them, and deleting them.

Modelverse Kernel (MvK)
-----------------------

The Modelverse Kernel communicates with the MvS and interprets its data.
The Modelverse Kernel has no way of storing data, except by sending it to the MvS for storage.
Through this architecture, the MvK becomes completely stateless and easily replacable.

For the MvK, a set of rules is defined which tell it how to interpret the graph in the MvS.
Complex programs can be written by encoding the program as a graph, and letting the MvK interpret it.

To allow for maximal flexibility, the MvK can never expose the users to the internal identifier of the MvS, which the MvK uses.
This allows the MvS to internally restructure itself without having to worry about stale references elsewhere.

Modelverse Interface (MvI)
--------------------------

The Modelverse Interface is the part that most users will be using.
It presents a textual or graphical interface to the Modelverse itself.
Depending on the interface, the MvK and MvS will serve only as a repository (heavy client), or they serve as the tool itself (thin client).
Either way, the communication is identical, just the granularity differs, and the place where the algorithms are implemented.

Traditionally, the MvI is a compiler that compiles some code to either a graph, or operations for the MvK.
This can, however, be any possible kind of tool, or even combination of multiple tools.
For example, a graphical tool could serve as an interface to the Modelverse, where it just processes the graphical events and sends the desired operations (such as creating an element) to the Modelverse.
