aspose file tools*
The moose likes OO, Patterns, UML and Refactoring and the fly likes Is Observer pattern implemented using Multi-Thread in Java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » OO, Patterns, UML and Refactoring
Bookmark "Is Observer pattern implemented using Multi-Thread in Java" Watch "Is Observer pattern implemented using Multi-Thread in Java" New topic
Author

Is Observer pattern implemented using Multi-Thread in Java

Matt Brown
Ranch Hand

Joined: Jan 26, 2004
Posts: 70
It is built in java.util.Observer interface and java.util.Observerable class. It seems it has to be implemented
using multi threads in java. Am I correct?


"I just use my muscles as a conversation piece, like someone walking a cheetah down 42nd Street." - Arnold Schwarzenegger
Jan Cumps
Bartender

Joined: Dec 20, 2006
Posts: 2503
    
    8

Hi Matt, Why do you think that?

From the javadoc:
Note that this notification mechanism is has nothing to do with threads and is completely separate from the wait and notify mechanism of class Object.


OCUP UML fundamental and ITIL foundation
youtube channel
Arnold Reuser
Ranch Hand

Joined: Nov 20, 2003
Posts: 196
You can read the code if you would like to : http://kickjava.com/src/java/util/Observable.java.htm
Nothing related to multi-threaded.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Is Observer pattern implemented using Multi-Thread in Java