Home Segments Top Top Previous Next

698: Sidetrip

Programming languages that are not object oriented, such as C, support the callback style of user-interface programming. When using the callback style, you connect specific procedures to hooks provided for the particular events generated by specific components.

Java offers the much more powerful delegation style of user-interface programming. Each component delegates to connected listeners responsibility for responding to events. Use of listeners confers several virtues: