Revision 60b85fe10793879b2f357c5173c2e858d57ea221 (click the page title to view the current version)
Behavioral Modeling - Power Window
- Modeling
variability and structures with variability
- Feature modeling
- Structural modeling
- Variability in structural models
- Variability in Behavior Using Inheritance
- Variability in Behavior Using Strategy Pattern
- Scenarios and Properties
- An example positive scenario
- It must be possible to go from closed to open via partiallyOpen state
- It must be impossible for the user to request opening and the window remains closed
- It
must be impossible for the window to be
closedand continue sendingmotorUpcommand - The
window must never continue
movingUpafter an object was detected
Modeling variability and structures with variability
Feature modeling
Metamodel
Model
Structural modeling
Metamodel
Model
Commands and requests.
Window motor
Window controller
Variability in structural models
Linking the feature with the optional component (structural variability)
The component pinchDetector is only required if we
support the feature pinchProtection.
Disabling
objectDetected port
Without the feature pinchProtection, the port
objectDetected should be inactive. Having the feature will
allow receiving the signal objectDetected.
Alphabet variability
The user request expressUp is only available when the
feature express is present.
Variability in Behavior Using Inheritance
Two kinds of window controllers:
With continuous chime
With intermittent chime
Variability in Behavior Using Strategy Pattern
We first define an abstract chiming strategy: chiming can be
audible but only if active (expressed by
nesting).
Concrete strategies:
Now we can parameterize the controller with a chiming strategy. Chiming should be active when moving up in express mode. The chime should be emitted only when the chiming is audible.
We can choose the chiming strategy using the following constraint:
Scenarios and Properties
An example positive scenario
It must be possible to go from closed to open via partiallyOpen state
It must be impossible for the user to request opening and the window remains closed
It
must be impossible for the window to be closed and continue
sending motorUp command
It is a safety property to prevent burning the motor.
The
window must never continue movingUp after an object was
detected
It is a safety property to prevent injury.
