Skip to content
Jegp edited this page May 29, 2012 · 1 revision

The mainline of Siigna is the framework of the software. The sole goal of the mainline is to provide functionality that can be utilized by the modules. The mainline should not and does not contain any code to control the application or, in other words, anything that can perform actions upon the user of the application. This interaction should happen by the user and through the user only. This is a key aspect of the modular design written below.

Table of Contents

Architecture

The Siigna mainline architecture is based on the model-view-control design pattern. The mainline has three responsibilities:

  1. Store and draw shapes
  2. Manipulate shapes
  3. Manipulate visual interface

Store and draw shapes

Storing and drawing are not as simple as it seems in Siigna but still probably the most important functionality of the program. In principal though it is pretty straight-forward: Storing happens in the Model which basically is a list of all the shapes currently in the program. The View takes these shapes and draws them on the screen.

Manipulate shapes

In practice, however, we need more than that. What happens for instance when the application closes and all the shapes the user spent painstaking moments to draw disappears? Or; What if the user accidentally deletes all the shapes and reaches for the panic-button which does not yet exist? The answer to these questions are Actions. Actions in Siigna can be seen as "things that can happen to shapes", i. e. creating, deleting, moving, scaling, rotating and so forth. They have two important properties: They can be executed and undone (command pattern if you like). Furthermore Actions are the one single thing that can change the model. Nothing else is permitted to do so.

Besides being used in the client Actions are also sent across the network to possible collaborators. Exploiting feature #1 of actions, execution, we can give these actions to other clients which will receive the exact same changes as the user that sent the actions.

Manipulate visual interface

Visual manipulation can happen in two ways: Each Module are given access to their own paint-method with very powerful means to control the graphical environment. Realizing that can be slightly cumbersome we implemented something we called a Display which can display nice-looking boxes on the screen. Nifty, right? These displays are accessed through the Siigna object described below.

Siigna

See Siigna object
Siigna contains a lot of information and it can sometimes be quite hard to keep track of it all. Besides the model, view and controller there are other types of information and meta-content (server attributes, visual preferences and so on) that needs a place to stay. We named that place Siigna (in Scala the type of entity is called an object, hence Siigna object). Siigna is basically two things: Graphical entry-point and place-holder for meta-content.

Mainline on GitHub

Like the Modules the mainline is maintained on GitHub at https://github.com/Siigna/main. Feel free to clone the repository and work on your own version of the modules, but please remember that Siigna is licensed under Creative Commons - read more under Siigna license.

See also

Clone this wiki locally