question 3

Posted Thursday, September 03, 2009 by SacrosanctBlood in

An object or a set of objects have to be notified that the data or the
state of some other object has changed and it can proceed to do some
logic. How can you implement this in java using the features provided in
java language?



1 comment(s) to... “question 3”

1 comments:

SacrosanctBlood said...

Java provides:

1. Observer -- any object that wishes to be notified when the state
of another object changes must implement this interface.
2. Observable -- any object whose state may be of interest, and in
whom another object may register an interest must extend this class, and
then add the Observer’s to this Observable.



Using the above two concept the below use case can be solved.



Post a Comment