java - Observer Design Pattern -
Observer Design Pattern , the topic notifies all observers by calling update ()
A method of conducting each supervisor
notify zero () (for (supervisor: supervisors) {observer.update (this);}}
But the problem here is that each supervisor is updated in the sequence and the update operation is not called for the supervisor. Not all supervisors are updated unless a supervisor has an
- Is there any way to solve this problem?
- If so, would that be a good example?
The classic design pattern does not include similarity and threading. For the observers, it is necessary to create N threads. However be careful, because it needs to secure their thread safely.
Comments
Post a Comment