|
| | The Java 1.0 event model was simple and
well suited for writing basic applets and applications.
However, it did not scale well for larger
Java programs because:
- The requirement to subclass a
component in order to make use of its
functionality is cumbersome to developers, and
improper use of subclassing.
- The inheritance model does not
lend itself well to maintaining a clean
separation between the application model and the
GUI, because application code must be integrated
directly into the subclassed components at some
level.
- Since all event types are filtered
through the same methods, the logic to process
the different event types is complex and
error-prone. This becomes worse as new event
types are added to the AWT.
- There is no filtering of events --
they are always delivered to components whether
those components actually handle them or not.
This produces a general performance problem,
particularly with high-frequency type events such
as mouse moves.
- For many components, the action()
method passes a String parameter which is
equivalent to either the label of the component
(Button, MenuItem), or the item selected (List,
Choice). This often results in poor coding and
unwieldy string comparison logic that doesn't
localize (internationalize) well.
|