Model change notification
by, 04-26-2012 at 07:37 PM (563 Views)
Any interested parties shall be notified by the modes when value or data gets changed. JavaBeans Event model is used by the Swing models for notification implementation. Two approaches used in Swing for this notification:
- A lightweighted notification shall be sent which has been changed by the state and listener is required to rsend back the query to model for determining what has changed. This approach has an advantage that one event instance might be used from a particular model for all of the notifications.
- A stateful notification shall be sent which more precisely describes that how model gets changed. A new interface is required by this alternative for every notification. This is usually desirable in case when enough information is not provided to the listener by the generic notification to efficiently find out that what changes occurred when model is queried.