Chapter 4 Using Activities in ADL
There are some situations when it is important to know if an object has any NROs subscribed to one or more of its activities. For example, suppose you wanted to develop a new class of buttons that have the property that the button's label is presented in different colors depending on whether or not any NROs are subscribed to its Pressed activity. In this situation, AM2 can provide notification whenever the number of NROs subscribed to an activity changes from zero to one or more, or vice versa. This capability is a standard feature of all activities.
In AM2, all activities have an associated second activity with the same name as the original followed by a question mark (?). You can use it for subscription notification. Thus, if an object has a Pressed activity then it automatically manages an activity named Pressed? that is triggered whenever the number of NROs subscribed to the Pressed activity changes from zero to one or from one to zero.
Generated with Harlequin WebMaker