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, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access