Home   :   Matrix Language

Matrix Modeling Language

 

Follow us on

Twitter

 

 

Discuss us on

LinkedIn

 

 

 

Watch us on

YouTube

 

 

Email us at

UltraDark

mike@ultradark.com

 

 

Get our code at

GitHub

 

Matrix Abstraction

 

The Matrix Language is the language of the Analysis Design Matrix which is shown in the Matrix Diagram and described by the Matrix Theory of Software Engineering.

 

Matrix is an abstract language that is designed to be translated to any programming language, such as C based languages including Java and other languages such as Ada and VHDL; although it is possible to create a Matrix language interpreter.

 

Working at the analysis level of abstraction, Matrix has no programming level concepts such as arrays, pointers and global variables of customary 3GL code.  It does, however, have similar or overlapping concepts such as local data and assignment statements that are used by the analyst to specify how for example, entity attributes are calculated.

 

Modeling is a different activity to that of programming.  The language concepts dealt with during modeling are different to those being dealt with during programming.  When a program is being written, that's called programming not modeling.  When a model is being created, that's called modeling not programming.

 

Matrix models are never called programs because models and programs deal with different semantics. However, the actual text used to describe a Matrix model is sometimes called code.

 

Although development with a textual language is more efficient, it is strongly advised that to properly visualise a model a graphical tool is required.

 

 

Matrix Operation

 

Building models with Matrix lets the analyst think and work at higher levels of abstraction.

 

The Matrix language is structured and formatted to allow the analyst to express each fact about the Real World in just one place and what's more, in only one way.

 

Matrix is a very scalable language that purposely constrains the writing and presentation of code while allowing the analyst a great deal of scope to express extremely large and complex systems for which it has been especially designed. 

 

Most coding style rules are enforced by the Matrix language simply by the type of statements employed and their structuring.  Other rules are enforced by the Model Compiler.

 

Matrix code requires no acronyms or object identifiers, though signifiers may appear to perform a similar purpose.  A signifier, such as "Robot", means use the Robot object that is currently in context.  It does not represent the actual object itself, although this may be the effect.  Similarly, Robot.Distance means use the Distance attribute of the Robot object currently in context.

 

Unlike other action languages, objects can only be present as part of entities.  This means there are no conceptual problems involving redundant copies of objects, simply because they cannot be copied.

 

A textual modeling language makes refactoring, searching, merging and establishing the difference between two model versions relatively easy using common tools (compared to graphical models).

 

 

Matrix Structure

 

The purpose of Matrix language statements, like graphical tools and other action languages, is simply to populate higher level metamodels.  It is the purpose of the Model Compiler to generate code from these metamodels.

 

Each Matrix model is well structured and statements are laid out in a very similar fashion.  A simplified view of the language's high-level system structure is shown below:

 

    System

        Matrix

            Silo

                Realm

                    Domain

                        Entity

                            State

 

 

Not only does this show how the statements relate together but also how the underlying entities relate to one another in the constraints of the language syntax.

 

 

Matrix Statements

 

Matrix Language statements are grouped according to their complexity or the subject areas they address.  Below is an overview of the types of statements that presently exist in Matrix:

Statements:

Primitive Statements:

System Statements

Action Statements

Object Statements

Pattern Statements

Auxiliary Statements

Utility Statements

 

 

Professional Edition Statements

 

Not all Matrix statements are available in all editions of the Matrix Model Compiler. The free Learning Edition has all the primitive statements along with a selection of other statements but no pattern statements.

 

The Professional Edition comes with all the statements in the Learning Edition plus pattern statements and some other advanced statements. Statements that are not available in the Learning Edition are shown in italic.

 

 

UML Diagram Notation Conversion

 

Unfortunately, the existing de facto UML notation is sub-optimal for Matrix analysis. Instead, the notation used in the Shlaer-Mellor method has been enhanced for use with the Matrix language. For completeness, the names of the Shlaer-Mellor diagrams have also been included in the table below:

 

 

Matrix Notation Executable UML Notation Shlaer-Mellor Notation
Domain Bridge Diagram (DBD) Package Diagram Domain Chart
Entity Relationship Diagram (ERD) Class Diagram Information Model
State Transition Diagram (STD) Statechart State Transition Diagram
Process Flow Diagram (PFD) Activity Diagram Action Data Flow Diagram

Modeling the way it's meant to be

 

Matrix Language Examples

 

Over time various models will be developed as Matrix examples and discussed in tutorials:

 

Hello World! - The standard Hello World! demo that every language must have.

 

Ping Pong - A model that demonstrates generating and listening for events.

 

Zig Zag - A model that demonstrates the asynchronous creation and deletion of objects.

 

Banking Application - This model is taken from the book Object Lifecycles: Modeling the World in States by Sally Shlaer and Stephen J. Mellor.

 

Passenger Elevator - A model that describes a workable elevator (lift) system that employs a simplistic allocation algorithm.  An assigner entity is used to resolve any possible contention for elevators.

 

Windows WiX Installer - A model that model generates an application's WiX installation source file in XML format. The file is processed by the WiX toolset to produce an installable MSI file for the Windows platform. This model is used to generate the installer for the Model Compiler download.

 

Gothic Hotel Controller - This model is based on a state machine design of an amusing but fantastical security system described by Martin Fowler in a discussion of Domain Specific Languages. The subsequent example model, Gothic Hotel is based on entities abstracted from the problem space.

 

Gothic Hotel - This example presents how the Gothic Hotel securty system should be analysed using entities abstracted from the problem space. The previous example model, Gothic Hotel Controller followed the original article by implementing a state machine based solution.

Copyright 2017 Dark Matter Systems Ltd. All Rights Reserved.