-
Notifications
You must be signed in to change notification settings - Fork 0
Creation and deletion
When creating or deleting instances we need to consider how the action is synchronized and how it impacts the integrity of model relationships.
When creating or deleting instances we need to consider how the action is synchronized and how it impacts the integrity of model relationships.
Creation can be triggered asynchronously by sending a creation event specifying the class of the instance to be created. Asynchronous deletion is achieved by addressing an ordinary event to the instance to be deleted where that event triggers a transition to a deletion state.
Scrall provides syntax both for signaling ordinary events and for sending creation events.
Synchronous creation and deletion are performed remotely by an action in some location other than that of the target instance’s state model.
Scrall provides syntax for both synchronous creation and deletion actions.
The class model specifies various constraints on relationships that must be respected by the state and activity models to ensure model integrity while the models are executing. It is the responsibility of the modeler to ensure that all constraints are respected in the model activities. For example, in a 1:1 association when an instance on one side of the association is deleted, the instance on the opposite side should be likewise deleted or linked to a newly created instance. It is also the modeler’s responsibility to ensure that all attributes have meaningful values at all times. There is no provision for assigning a null (lack of a value) to an attribute.
A referential attribute, in particular, must always hold a legal value. This means that you cannot create an instance with referential attributes if the referenced instance does not yet exist. It also means that you cannot delete an instance currently referenced by one or more referential attributes.
Say, for example, that you have a 1:1 association between classes A and B where A holds a reference to B. You must delete the A instance first and then the B instance immediately after and not in the reverse order. This ensures that you never orphan any referential attributes.
Copyright 2020, 2021, 2022, 2023, 2025 © Leon Starr under MIT Open Source License
- Why they are problematic
- Instance attribute creation values
- Boolean values
- Special values
- Enumerated values
- Action block
- Statement
- Single line action
- Multiple dependent actions on a single line
- An action spread across multiple lines
- A conditional group of single line actions
- Comments
- Finding instances
- Attribute access
- Creation and deletion
- Subclass migration
- Creating a table from a class
- Creating a table with a definition
- Converting a table into a class
- Set operations on tables
- Set comparisons on tables
- Join
- Rename
- Extend
- Aggregation
- Rank
- Image
- Input values
- Signatures and name doubling
- Output values
- Execution order
- Sequential execution
- Conditional execution
- Signals
- Scrall has no for_each action
- Iteration