DEV Community

Discussion on: Design Patterns: Observer Pattern

Collapse
 
henriavo profile image
Henri Idrovo • Edited

Good question Marlysson! I had the same thought when I was reading this chapter. The text doesn’t mention why they chose this design. But they did give another example of the Observer pattern implementation in the JDK, specifically in Swing. And in this example, the Subject constructor take an Observer, and registers it as an observer. So I guess it’s flexile?

Collapse
 
marlysson profile image
Marlysson Silva

I agree. When I was studying these patterns emerged the same doubt. I think there are severals design to implement observer pattern, each one suitable to right problem.