Most voted "observer-pattern" questions
The Observer is a software design standard that defines a one-to-many dependency between objects so that when an object changes the state, all its dependents are notified and updated automatically. Allows interested objects to be warned of status change or other events occurring in another object.
Learn more…14 questions
Sort by count of
-
21
votes1
answer5221
viewsHow does Design Pattern Observer work and how does it implement it?
I am in doubt regarding Design Pattern Observer, when its working and how to use(present practical example).
-
16
votes1
answer1422
viewsListeners are an Observer implementation?
I’m trying to understand the concept of Observer and its implementation, and I ended up finding this example where it is used listeners instead of classes observable and observer: This graph has…
-
10
votes1
answer1326
viewsLaravel 5.3 - Events or Observers?
I have some scenarios where I can use Observers to fire a notification, however, for me it would be indifferent to use Observer or create an Event, a Listener and then use this to fire a…
php laravel pattern-design event-listener observer-patternasked 8 years, 1 month ago Fábio Jânio 3,407 -
10
votes1
answer151
viewsIs there any technical reason for the Observer pattern or similarities not to be used independently of the observed object?
We often use things we don’t even think about because it’s like this. I don’t like to put mechanism bumpers on object that is of specific domain. If I have a screen control or a client who has some…
-
8
votes2
answers248
viewsAlternative to Observable and Observer in Java 9
For testing purposes, I am porting an application from version 7 to version 9 of Java. This application has some features that use Observer and Observable. I realized that both became obsolete:…
java pattern-design characteristic-language observer-pattern java-9asked 7 years, 1 month ago Homer Simpson 3,001 -
7
votes1
answer716
viewsWhat are the right practices to handle events in PHP?
I created some classes and an interface to manipulate events for a small MVC application. My intention is to implement the Observer standard, but I do not know if it agrees, since I still confuse…
-
7
votes1
answer146
viewsCan Observer be considered encapsulation break?
Observer use of abstraction and interfaces. Let’s assume that a Observer "assists" the state changes of certain classe and informs them to another external agent, we may consider this a…
-
6
votes1
answer368
viewsDesign Observer applied to events
I’m studying design standards and I’m trying to apply a real situation to them. And one example I did was on the event stage: In this scenario every event has participants to register. So, for that,…
-
6
votes3
answers153
viewsWhat is the way to check and react to a change of state of an array using pure Javascript?
I’m studying about the pattern Observer where in an example done in Java it was demonstrated that an X class any called a specific method Y and this called methods updateof the observers, that is to…
-
4
votes1
answer416
viewsHow to implement the Observer standard in practice, with database?
I’m studying some design patterns, and right now I’m learning about the pattern Observer. I’ve read books, I’ve seen some classes on Youtube, I’ve done the examples and everything. But now I would…
database pattern-design software-engineering observer-patternasked 8 years, 8 months ago Fábio Lima 81 -
1
votes0
answers21
viewsObservers can be injected into the observable?
It’s a half-ass question whose answer might be "make the most sense of the code," but it doesn’t hurt to ask. The pattern Observer suggests that an observer register (via…
-
0
votes1
answer86
viewsDefinition of Publisher-Subscriber and Observer standards
Today I was evaluating a article (English) concerning the differences between the Observer and Publisher-Subscriber standards, I had until then the view that both were the same thing! Even quoting…
-
0
votes0
answers36
viewsHow to detect changes in an iframe’s innerHTML and run a function with Mutationobserver?
I’m creating an extension for Chrome and I need it to detect (within an iframe) when an object’s innerHTML is changed and performs an action, example: button.click();. How can I create this…
javascript dom iframe google-chrome-extension observer-patternasked 3 years, 8 months ago Roger Windberg 71 -
-1
votes1
answer44
viewsCancel subscribe
I’m performing a call to API that returns me a list of any obj when I click on a button. That is if I click twice in sequence, the API returns me the same list in sequence as well. My question is,…