![]() ![]() |
|||
|
|||
Before starting to create the FSA formalism, let's get a look on the language we use in AToM3
to create such formalisms : Entity-Relationship. Please close the current formalism (FSA) and
open the file named "EntityRelationship.py" in the ERModels directory:
|
|||
![]() |
|||
The interface we have by default when loading AToM3 will appear on your screen:
|
|||
![]() |
|||
The entity-relationship formalism contains two distinct constructs that are entities and relationships.
An entity may be connected with other entities through the relationships. Now, If we get a closer look on each
button of the graphical user interface: |
|||
|
|||
|
|||
|
|||
This button creates a new entity where the mouse was clicked on the canvas.
Example
|
|||
|
|||
This button creates a new relationship where the mouse was clicked on the canvas.
Example
|
|||
|
|||
|
|||
|
|||
After being pressed, this button generates the options window of an object clicked on the canvas.
Example
|
|||
|
|||
After being pressed, this button connects the two objects on the canvas specified by the user.
Example
|
|||
|
|||
After being pressed, this button deletes an object on the canvas specified by the user.
|
|||
|
|||
Allow to create composite models where a node of the graph is actually a model itself. |
|||
|
|||
Allow to create composite models where a node of the graph is actually a model itself. |
|||
|
|||
|
|||
|
|||
After being pressed, this button curves an inserted point in a connection.
Example
|
|||
|
|||
After being pressed, this button insert a point in a connection, allowing it
to avoid other objects.
Example
|
|||
|
|||
After being pressed, this button deletes a point from a connection.
|
|||
|
|||
After being pressed, this button changes the connector of a connection to another
connector selected by the user
|
|||
|
|||
Now, lets explore in details the properties of entities and relationships. If you click on "edit entity" and then on any entity/relationship on the canvas,
you should get something like this:
|
|||
![]() |
|||
|
|||
The name that the entity/relationship will have in the generated formalism. For example, "state" was the name of an entity
in the meta-model of the formalism we used to create the water FSA.
|
|||
|
|||
The allowed number of connections the current entity/relationship can have as a source or as a destination with other objects in the
generated formalism.
|
|||
|
|||
The attributes an entity/relationship will have in the generated formalism. Those attributes must be of ATOM3Type. For example, in
the FSA formalism meta-model, the "state" entity had an ATOM3Boolean attribute "isInitial".
|
|||
|
|||
A list of constraints (written in python code) related to the current entity/relationship. For example, we may want to prevent the user
from giving specific values to some attribute. A violated constraint will issue a warning to the user at the modeling level.
|
|||
|
|||
The appearance an entity/relationship will have in the generated formalism. For example, in the FSA formalism meta-model, the appearance
of the entity "state" was colored circle.
|
|||
There are also properties for the model. If you select "edit model attributes" in the
model
tab of the top menu, you will get a properties
screen
similar to what we had for the entity/relationship. However, those properties apply to the whole model (so there are no global "appearance" or "cardinalities"). For example, you
could have a global constraint affecting many objects on the canvas (like a unique name constraint for the "states").
|
|||
You can save your current work by
selecting
"save as" in the file tab of the top menu.
**Note on naming convention: Nameofyourmodel_ER_mdl.py** <-- start with capital letter |
|||
In short, the Entity-Relationship formalism is used to create new formalisms. We do that by connecting entities with relationships and
specifying the names, cardinalities, attributes, constraints and appearance the entities/relationships will have in the generated formalism.
|
|||
| |||
![]() ![]() |