Skip to content

Siigna main architecture

Jegp edited this page May 29, 2012 · 2 revisions

The Siigna Mainline Architecture

Table of Contents

Mainline structure

Mainline consist of three parts:

  1. app (model-view-controller)
  2. module
  3. util

Model view controller

The application itself (https://github.com/Jegp/siigna/tree/master/src/main/com/siigna/app) implements the widely used model-view-controller pattern.

Model

An immutable model with two layers: an static and dynamic. The static part is basically a long list of all the Immutable Shapes and their keys in the Model. The dynamic part allows selecting parts of the global immutable layer. These shapes can be altered without changes in the static layer which allows for significant performance benefits. When changes have been made (and the shapes are deselected), the shapes are removed from the dynamic layer, and the actions which have been applied on the dynamic layer is applied on the static layer.

View

The view is responsible for painting the appropriate content, and transforming the zoom scale and the pan vector.

Controller

The Controller controls the core of the software. Basically that includes dealing with the event-flow to the modules.

Module

Module contains one file only, a parent class for all Modules. Modules provide different means for interacting with Siigna, and are located in https://github.com/Jegp/siigna-modules

The class is basically an immutable descriptions of what to do in case of certain events. Is a scala trait.

Util

Util contains various utilities needed in both Mainline and Modules. For instance a library of commonly used methods to evaluate geometry, Eg. "what is the center of a rectangle?" It also holds a list of preferences, settings that change the appearence and performance of Siigna.

API

If you are having a hard time figuring out what is what or if you would just like to take a closer look on the software, the application programming interface (API) can be found at siigna.com/api.

See also

Clone this wiki locally