All Questions

137
votes
6answers
74244 views

Delegation: EventEmitter or Observable in Angular

I am trying to implement something like a delegation pattern in Angular. When the user clicks on a nav-item, I would like to call a function which then emits an event which should in turn be handled ...
147
votes
10answers
111491 views

When should we use Observer and Observable

An interviewer asked me: What is Observer and Observable and when should we use them? I wasn't aware of these terms, so when I came back to home and I started Googling about Observer and Observable ...
112
votes
9answers
108712 views

Super-simple example of C# observer/observable with delegates

I recently started digging into C# but I can't by my life figure out how delegates work when implementing the observer/observable pattern in the language. Could someone give me a super-simple example...
3
votes
1answers
1449 views

Leveraging the observer pattern in JavaFX GUI design

As noted here in the context of Swing, GUI design makes frequent use of the observer pattern. Having frequently used the scheme prescribed in EventListenerList, is there a Java FX example, such as Con...
16
votes
3answers
6327 views

Is there a recommended way to use the Observer pattern in MVP using GWT?

I am thinking about implementing a user interface according to the MVP pattern using GWT, but have doubts about how to proceed. These are (some of) my goals: the presenter knows nothing about the U...
37
votes
5answers
29835 views

How can I update information in an Android Activity from a background Service

I am trying to create a simple Android application that has a ActivityList of information, when the application starts, I plan to start a Service that will be constantly calculating the data (it will ...
32
votes
8answers
24054 views

Python Observer Pattern: Examples, Tips?

Are there any exemplary examples of the GoF Observer implemented in Python? I have a bit code which currently has bits of debugging code laced through the key class (currently generating messages to ...
66
votes
6answers
18040 views

Mediator Vs Observer Object-Oriented Design Patterns

I have been reading the Gang Of Four, in order to solve some of my problems and came across the Mediator pattern. I had earlier used Observer in my projects for making some GUI application. I am a bi...
18
votes
5answers
8330 views

Observe a File or Folder in Objective-C

What is the best way to listen to a folder or file to see if it has been saved or if a new file has been added?
24
votes
7answers
48272 views

pass function in json and execute

Is there any way that I can pass a function as a json string (conversion with JSON.stringify), send it to another function, parse the json and then execute the function that was in the json? I am usin...

Previous Next