Entity vs. entity type
A common source of confusion is the distinction between the terms 'entity' and 'entity type'. It is important to fully understand this terminology before diving deeper into VIKTOR's call-flow.
In short, an 'entity type' is the definition of a certain object, it's attributes and behaviour (logic) specified in (Python) code. An 'entity' is a single instance of an entity type. An entity always has a certain entity type and multiple entities can be created with the same type.
For example, an entity-type 'Cube' might be defined by its width, length and height. A 3 x 3 x 3 cube would be an entity of the type Cube, just as a 4 x 4 x 4 cube would be an(other) entity of the same type.
As a metaphor (thinking in terms of the Python language): the entity type would be a 'class', whereas an entity would be an 'instance' of the class.
Developer vs. User
Entity types are created by the app developer. The entity type's definition and logic are defined in the
Controller. Entity types are created during development.
On the other hand, entities (of the predefined types) are typically created by the user within the app, they are created and modified at run-time. Two entities of the same type share the same behaviour and the same set of attributes (since they share the same underlying code), but do not necessarily have the same attribute values.
For example, the user might create a new cube entity (with different width, length and height values) that resides next to the already existing two, or modify the 4 x 4 x 4 cube mentioned above to a 4 x 4 x 5 cube by updating the corresponding height field within the entity's editor in the app.
Entity vs. entity type
It is also possible for the developer to create predefined entities at development time (within the app file). In contrast, it is not possible for the user to create entity types (as he/she is not able to modify the underlying app-code).
Below are two example controllers (partly defined), in which the developer has defined 2 entity types: 'Project' and 'LatticeBoom' (the latter being a child-type of the former).
class Project(ViktorController): label = 'Project' children = ['LatticeBoom'] show_children_as = 'Cards'class LatticeBoom(ViktorController): label = 'Lattice Boom'
The figure below shows a snapshot of the current live application, as seen by the user. We can see that the user created an entity of type 'Project' (and named it 'my_project'). Within the created project, the user created 2 entities of type 'LatticeBoom' (notice that 'Lattice Boom' is its label seen by the user) and named them 'boom_1' and 'boom_2' respectively.
Entity vs. entity type in VIKTOR
Since the booms are of the same entity type, opening their corresponding editor shows the same
parametrization for both entities (after all, their logic is defined
Controller of the entity type). Nevertheless, the attribute values assigned by the user make them unique
(production location and required length (m) are set to 'Netherlands' and '100' for entity 'boom_1' and 'Korea' and
'120' for entity 'boom_2', respectively).
Entities 'boom_1' (left) and 'boom_2' (right) have equal parametrization but differ by value