1,841 questions
-3 votes
0 answers
65 views
Detecting changes to dictionary keys in Python without continuous polling [closed]
I am working on a configuration manager in python that loads settings into a dictionary and updates them dynamically during runtime. The issue I am facing is detecting when keys inside the dictionary ...
1 vote
1 answer
104 views
How to write polymorphic function extending abstract class which implements an interface generic function?
I'm trying to implement Observable pattern with an abstract class (so that my subclasses don't provide a common implementation). I want polymorphic functions for different Observer types. I have an ...
0 votes
0 answers
54 views
How to improve architecture of a Transfer Monitoring Service using Observer pattern in Spring Boot?
I'm developing a system for monitoring money transfers. The idea is to dynamically build SQL queries based on different criteria using the Observer pattern. Once the matching transfers are found, they ...
0 votes
1 answer
164 views
SwiftUI, Combine: pass @Published property as a @Binding to another object (delegation style)
I have a following synthetic example: final class MainViewModel: ObservableObject { @Published var response: String? func makeSecondaryViewModel() -> SecondaryViewModel { ...
2 votes
1 answer
311 views
How to implement thread-safe property wrapper notifications across different contexts in Swift?
I’m trying to create a property wrapper that that can manage shared state across any context, which can get notified if changes happen from somewhere else. I'm using mutex, and getting and setting ...
0 votes
1 answer
72 views
Rust observer pattern implementation with concrete data for each subscriber
I am working on a implementation of the observer design pattern where each observer is tied to a concrete type which should be received on notify. See the following minimal example: Playground link ...
2 votes
0 answers
153 views
Is the observer pattern impossible to implement in embedded Rust?
I work with C/C++ for embedded software development and I've been learning Rust recently trying to implement the same concepts I use at work. In our application, the observer pattern is largely used ...
1 vote
2 answers
110 views
Blazor Server Singleton Observer Pattern Holding References After Page Refresh
I'm using a singleton service in a Blazor Server app to notify components when an order changes. The service follows an observer pattern, where pages register event handlers that get triggered when an ...
0 votes
1 answer
68 views
Extended Observer pattern in rust with dynamic payloads
I'm trying to implement a variant of the observer pattern. Currently I have it like this (after the example on Refactoring Guru here): #[derive(Debug, PartialEq, Eq, Hash, Clone)] pub enum Event { ...
0 votes
1 answer
161 views
Decorating python properties with an observable pattern
I'm trying to create an observable decorator that adds the method "add_observer" to a property. The main issue I'm having is that I do not know how to treat the getter. It would be amazing ...
3 votes
2 answers
128 views
How to Implement a Custom Observer Pattern in Java Without Using Built-in Libraries?
I am trying to implement the Observer design pattern in Java without using built-in libraries like java.util.Observer or PropertyChangeSupport. I want to create a simple system where observers (...
0 votes
0 answers
43 views
How is the most ethical way to schedule Python to run N times a day?
a question regarding quality and best practices. In a system that requires many scheduled tasks, what is the "formal" way to handle this? When there is a number N of automation services ...
0 votes
0 answers
51 views
Observer Pattern Question - function not working
coding in unity/C# Ok so I am currently trying to improve my coding skills so I have been looking into the Observer Pattern, I have run into one issue currently. My upgrade button script has the event ...
0 votes
1 answer
79 views
Restrictive access in the Subject interface in the observer pattern
In this observer pattern, there is one more thing I am using: a push-pull mechanism, so there is a reference from observer to subject also. so now when the Subject is part of the observer itself that ...
0 votes
1 answer
71 views
Wrong observer list used when implementing Subject twice with Observer pattern
I have implemented a simple Observer pattern in c++ like this: template<typename T> class Observer { private: virtual void notify(const T& data) = 0; public: virtual ~Observer() = ...