SEARCH
0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Prev | Current Page 60 | Next

Jonathan Jacky, Margus Veanes, Colin Campbell, Wolfram Schulte

"Model-Based Software Testing and Analysis with C#"

2??“3.6). The observable actions are implemented by events, and the controllable
actions are implemented by methods called handlers. The program waits
for an observable action. When one occurs, the program executes a dispatcher, code
that selects a handler, and then executes the handler selected by the dispatcher. When
the handler returns, the program waits again for the next observable action.
We divide our control program into two classes. The Controller class is a library
that contains the dispatcher and the handlers (Figures 3.2??“3.4). It is largely
independent of any operating system or framework.1 We also provide a simulator
application, so we can experiment with the control program design on any computer
that provides the .NET framework. The simulator substitutes for the much more
elaborate support (including device drivers, etc.) needed by the actual control program.
The Simulator class is an application that generates the events that implement
our observable actions (Figures 3.5 and 3.6). It also provides a rudimentary user
interface so we can raise events by clicking buttons on a form.
Our simulator uses C# events and the .NET framework, in particular the event
machinery provided by the System.Windows.Forms namespace. For example, in our
Simulator class, c.timer is the .NET timer and c.timer.Tick is its Tick event
(Figure 3.5). The statement
c.


Pages:
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72
hotel jelenia góra Russian bride Free English grammar and study guid powiekszenia wielkoformatowe counter strike 1.6