-
Notifications
You must be signed in to change notification settings - Fork 0
Instance attribute creation values
First, consider new instance creation. The UML standard already suggests a solution with the initial value field on the class diagram. This is a value applied by default to the attribute of any new instance. This moves default initial values out of the action language and into the class model. When an instance is created, the model execution architecture will use those initial values if no other value is specified.
For example, if you want to ensure that every instance of Dog has its Dog.Breed attribute initialized with the value “Collie”, just put that value in the appropriate class model’s initial attribute value definition. Then, when you create a new instance of Dog, omit the Breed attribute like so:
new dog .= &R1 *Dog( Name: ^Supplied name )
Here a new instance of Dog is created via the * create instance action and referenced along relationship R1 via the & relate action with the instance references to assigned to the new dog single instance flow.
And the breed will be set automatically to "Collie" since it wasn’t specified. The rightmost part of the action links the newly created Dog to the local instance, presumably Dog Owner, on the R1 association.
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