Concepts of Programming Languages

(Sean Pound) #1
Review Questions 665

An event is a notification that something has occurred that requires spe-
cial processing. Events are often created by user interactions with a program
through a graphical user interface. Java event handlers are called through event
listeners. An event listener must be registered for an event if it is to be noti-
fied when the event occurs. Two of the most commonly used event listeners
interfaces are actionPerformed and itemStateChanged.
Windows Forms is the original approach to building GUI components
and handling events in .NET languages. A C# application builds a GUI in this
approach by subclassing the Form class. All .NET event handlers use the same
protocol. Event handlers are registered by creating an EventHandler object
and assigning it to the predefined delegate associated with the GUI object that
can raise the event.

BIBLIOGRAPHIC NOTES


One of the most important papers on exception handling that is not connected
with a particular programming language is the work by Goodenough (1975).
The problems with the PL/I design for exception handling are covered in
MacLaren (1977). The CLU exception-handling design is clearly described by
Liskov and Snyder (1979). Exception-handling facilities of the Ada language
are described in ARM (1995) and are critically evaluated in Romanovsky and
Sandén (2001). Exception handling in C++ is described by Stroustrup (1997).
Exception handling in Java is described by Campione et al. (2001).

REVIEW QUESTIONS



  1. Define exception, exception handler, raising an exception, disabling an excep-
    tion, continuation, finalization, and built-in exception.

  2. What are the two alternatives for designing continuation?

  3. What are the advantages of having support for exception handling built
    in to a language?

  4. What are the design issues for exception handling?

  5. What does it mean for an exception to be bound to an exception
    handler?

  6. What are the possible frames for exceptions in Ada?

  7. Where are unhandled exceptions propagated in Ada if raised in a subpro-
    gram? A block? A package body? A task?

  8. Where does execution continue after an exception is handled in Ada?

  9. How can an exception be explicitly raised in Ada?

  10. What are the four exceptions defined in the Standard package of Ada?

Free download pdf