-
Notifications
You must be signed in to change notification settings - Fork 3
Subclass Switch Action
Leon Starr edited this page May 14, 2022
·
3 revisions
For any given Generalization, an enumerated type can be automatically generated based on the set of Subclass names. Each assignable value corresponds to a Subclass name in the specified Generalization.
With that capability, the modeler can then simply specify an instance of a Superclass and the associated Generalization. A subclass switch action can then be defined where each Case corresponds to one of the Subclass names. In this manner the modeler can then defines a distinct set of Actions to enable depending on a Superclass instance's related Subclass.
Here's an example with Scrall notation:
R38? {
.Top Bank Level:
// If this is a top level and down is requested, clear the down request
// set/unset are type specific operators defined on the Boolean type
(in.dir == .down) /R38/Top Bank Level.Calling down.unset
.Bottom Bank Level:
// If this is a bottom level and up is requested, clear the up request
(in.dir == .up) /R38/Bottom Bank Level.Calling up.unset
.Middle Bank Level:
in.dir? {
// If this is a middle level and up is requested, clear up
// If this is a middle level and down is requested, clear up
.up: /R38/Middle Bank Level.Calling up.unset
.down: /R38/Middle Bank Level.Calling down.unset
}
}
- Action + Activity + Domain
No non-referential attributes
Copyright © 2021-2023 Leon Starr