Skip to main content

Questions tagged [observer-pattern]

A software design pattern in which an object, called the subject, maintains a list of its dependents, called observers, and notifies them automatically of any state changes, usually by calling one of their methods.

0 votes
0 answers
52 views

Rust Observer/Subscriber design pattern

I have written a sample Observer/Subscriber design pattern where, in my application there is a networ_receiver thread, ...
Harry's user avatar
  • 429
6 votes
2 answers
105 views

Observer pattern written in C++

I just carefully studied the observer pattern. And I wrote a demo snippet to better undertand it. I am not so sure that if it's the right way to define ...
John's user avatar
  • 459
4 votes
1 answer
76 views

My C++ Implementation of the Observer Pattern

I have written my own basic implementation of the Observer pattern. Please code review it as you feel. This is a one file implementation, and any feedback no matter how small is appreciated. One ...
Archie Payne's user avatar
4 votes
2 answers
186 views

Dependency problem with field changes

The Observer Pattern is used here to notify changes in a Person's data. For example, when age changes, the value of can_vote() ...
prestokeys's user avatar
  • 1,371
2 votes
2 answers
458 views

Generic observable type

I am writing an observer design pattern that is not too complex but I still feel there's a lot for me to learn about C++ be it little details (especially coming from C). A couple of observations: I ...
xyf's user avatar
  • 508
0 votes
1 answer
183 views

PyGame Event Handling

I'm new to pygame and tried to write my own Event Manager because I couldn't find a solution I was satisfied with. So I wrote my own inspired by the observer pattern: ...
lukstru's user avatar
  • 968
1 vote
1 answer
601 views

Multithreaded observer pattern in Rust

I often want to program in an event driven way, but classic implementations of the observer pattern often pose an ownership challenge, and they only get more difficult once multiple threads are ...
Blue7's user avatar
  • 373
1 vote
2 answers
76 views

Requests and handling requests

For this task, I don't think that the Observer Pattern can be used in its classic form. Those who have received the requests and those who choose to accept the request are not the same group. Those ...
prestokeys's user avatar
  • 1,371
1 vote
1 answer
291 views

Typescript simple observable state and web component

I've been experimenting with wiring up a vanilla web component in a reactive manner to a state box. The goal is that when something changes on the state object, the web component reacts. I realize ...
Jeff Putz's user avatar
  • 113
4 votes
3 answers
354 views

Observer Design Pattern in C++ to model magazine subscriptions

My attempt at a observer design pattern (I know using namespace std isn't good). I'm very new to design patterns. Everything is inline with class definition. Please tell me if I'm doing anything wrong ...
Asphodel's user avatar
3 votes
2 answers
687 views

Generic Observer/Listener implementation in Java

I am working on a personal project in university where I am currently trying to make my own implementation of a generic observer pattern that I can use throughout my project. I would appreciate any ...
Emil Holmsten's user avatar
3 votes
0 answers
298 views

Android BMI calculator using LiveData

I have made a Body mass index-calculator using ViewModel and LiveData. Source-code of the MainActivity: ...
michael.zech's user avatar
  • 4,358
1 vote
0 answers
203 views

Unity3D Observable Variables as ScriptableObjects

I'm trying to implement an observable pattern on variables, so that I can hook up UI components, etc. to change displayed values or other actions when their value changes. I wanted three features that ...
Tom's user avatar
  • 223
0 votes
2 answers
1k views

C++ Observer Pattern with std::function

I am/we are using the observer pattern for many things in our application. I think it's time to create a reusable base class for these situations. Most implementations I could find only do something ...
Michael's user avatar
3 votes
1 answer
550 views

Adjusting variables on change of status attribute of my Order Laravel model on the updated event in observer

I have an order model and a client model. A client has many orders, an order belongs to a single client. In the client model I keep track of how much money a client paid (...
Bogdan Ta's user avatar

15 30 50 per page
1
2 3 4 5
7