Essential.Model

Models

A model is a representation of data or relevant knowledge. Structured models conforms to a pregiven set of rules called metamodel.

Essential provides a textual DSL for representing and editing models called: Essential.Model.

A quick introduction to its syntax follows:

Quick Sample

using Sample.Metamodel;
namespace Model1
{
    Project P1
    {
        Name = "Plan 9";
        Description = "Plan 9 from outer space";
        Milestones = [M1, M2];
    }
    Milestone M1
    {
        Name="Project Launch";
        Date="1/1/2009";
    }
    Milestone M2
    {
        Name="Project Conclusion";
        Date="1/1/2015";
    }
}

Basic primitives

The primitives of the Essential modeling language are described here:

Using clause

Allows the importation of external namespaces. Such namespaces can provide types (metamodels) or objects/instances (models) for futher referencing and usage.

Namespace

A namespace defines a naming scope where definitions like object instances can be created. Namespaces like UML packages, helps to organize the concepts when them increase in numbers.

Object instanciation

Objects can be instanciated inside a namespace using the class name and providing a unique name to such intance for further referencing.

Property values

Inside objects, properties can take values accordingly to the defined type.

Object references

External references
Objects references can be used as values when the property has the adecuate type. For example: in the quick sample M1 and M2 are used as references for the Milestones properties with the expression Milestones = [M1, M2];

Inline creation
Inlining allows to create the object just in place. Example:

...
    Project P1
    {
        Name = "Plan 9";
        Description = "Plan 9 from outer space";
        Milestones = [
             Milestone M1
             {
                Name="Project Launch";
                Date="1/1/2009";
             },
             Milestone M2
             {
                Name="Project Conclusion";
                Date="1/1/2015";
             }
            ];
    }
...

2 comments.

  1. Hi Pedro,

    Do you have anything in the plans for modeling behaviour?

  2. I have some ideas for adding behavioral aspects but not yet convinced by any of them. So, probably I will put my ideas to macerate a bit more before coming up with a solution.

Post a comment.