page header

Quick Model Editor

The Quick Model Editor is an editor to quickly specify definitions for relationships, entities and fields using a simple text DSL. You specify simple facts in text on a single line which are then processed and used to create a new element or execute a command. The Quick Model editor is especially designed for quickly logging information during interviews with domain experts. The editor has its own visual model viewer, which contains all entities mentioned during the session which also helps you get an overview of what the statements you enter do to the model: you can see your model evolve in front of you.

All elements created are directly created in the project and therefore you can undo your additions / changes by using the normal undo/redo procedure (Cntrl-shift-Z and Cntrl-shift-Y).

The Quick Model editor is opened by selecting Project -> Quick Model Editor from the main menu or by clicking the Quick Model button on the toolbar. The Quick Model editor consists of three parts:

  1. The large editor canvas which is a ModelViewer and which shows the entities mentioned in statements entered
  2. The command area with the display of the active scope and the Command input, which is the text editor area to specify statements. Statements are specified using a simple text based DSL, which is described below.
  3. The log area, which displays errors found in the statements entered or remarks about which elements were created, updated or removed.

Text based DSL

The idea of Quick Model is that the line entered is a description of a fact or a command to manipulate some element in the model. It's a simple editor which can aid users to define model elements which can then be refined with the other editors.

Syntaxis, rules

The quick model editor uses the following rules for its Text based DSL:

Syntaxis, names

A name (e.g. a name of an entity) can have one of the following structures:

S1 Element with name S1 within current scope's group, or sub element with name S1 within current scope's groupname:elementname
S1:S2 Element with name S2 in group S1
     S2  Sub element with name S3 in element S2 in current scope's group
    :S2.S3  Sub element with name S3 in element S2 in empty group
    :S2 Element with name S2 in empty group
S1:S2.S3 Sub element with name S3 in element S2 in group S1
S1: Group S1

 

Syntaxis, commands

The following commands are recognized (all commands start with a '#' character)

There are also some commands which are only for the model view area of the Quick Model editor:

Creating Entities fields and relationships

To create an entity with the name Customer, you simply type Customer in the command area and press Enter. If the current scope is an entity, the name has to be a full name (with group) otherwise the name is considered an element in the current scope, i.e. a field, and a field is created instead. The following directives are usable to create the various elements:

It's key to use the right scope to be really productive, so use the #u command often to switch from scope to scope. This way it's easier to type names, as you then don't have to specify the group name part or the entity name part. It's also important to remember that you can undo any change you made, by simply pressing cntrl-shift-Z, so it's not harmful to experiment with statements.

It's in general quicker to specify the relations first. By doing that you already mention the entities and these are then created as well. For example the statement Customer.Orders 1n Order.Customer creates two entities and 1 relationship, and it also defines the navigators for both entities for this relationship.

After entities have been created, you can then set the scope to one entity and specify the fields. As relationships are already setup by then, the FK fields are created automatically from the PK fields once the PK fields have been specified.

Intellisense Helpers

In the editor pane, there is some simple intellisense available. To display a list of values to help with the syntax, we have defined three key strokes:

Multi-line paste support

You can copy/paste multiple commands at once into the editor pane and execute them with one enter key press. Each line is then executed as one command. This can be handy if the list of entities to create is already available in text form.


LLBLGen Pro Designer v4.2 documentation. ©2002-2015 Solutions Design