O'Reilly logo

Graphic Java™ 1.2, Volume I: AWT, Third Edition by David M. Geary

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Inheritance-Based Mechanism

Under certain circumstances, an inheritance-based event handling mechanism may be preferable to delegation. For instance, if a class provides some fundamental functionality that is tied to a particular event, an inheritance-based approach might possibly be preferred. The JDK documentation for the event model stresses that the inheritance-based mechanism is to be used sparingly, if at all.

The JDK delegation event model provides an inheritance-based alternative to using delegation for event handling. The inheritance-based mechanism is based upon the original JDK event model and suffers from its shortcomings; as a result, we reiterate the documentation warning: the inheritance-based mechanism should be used sparingly, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required