observer

PrototypeJS observe windows dimensions change ?

Hi, I'm trying to create my own 'modal' window since none of these currently existing for PrototypeJS fits my needs. The problem is observing document.documentElement for change of height and width of viewport ( or document.body, depending on Quirks/Standard mode ). ...

How do I implement observer pattern on PHP + Javascript/jQuery?

Just like in SO, where one is answering a question, if somebody has answered said question, a notification will appear (via AJAX?). My only way of somewhat replicating this is by including a timeout on my script that fetches if there is an update every n seconds. Is there a way to do this using observer pattern on PHP + Javascript (w/ jQ...

observer iphone for view controllers

Is there any way to to check the current navigation controller or the view controller currently visible in application delegate method. I want to create an Observer in application delegate that observes the controller being pushed and pop from the stack so that i could display the required tab bar controller. Basically my app have more...

When observe pattern cause GC problems.

In a GC enabled language, when observer subscribes to events of subject, actually subject got a reference of observer. So before drop an observer, it must un-subscribes first. Other wise, because it's still referenced by subject, it will never be garbage collected. Normally there are 3 solutions: Manually un-subscribes Weak Referen...

Observer Pattern Overload

I'm stuck with the following scenario. It has a code smell, that I'm not happy with, but resolutions to it seems to be as complex, but just in different ways. I have a scene graph representing business objects. I've designed it so that the business objects themselves are as simple as could be. They're practically POJOs. Now, 1 entity m...

Using Observer pattern over a network for board game

I am looking to make a networked board game based on Risk in C++. My idea was to have a central server which hosts a game lobby where users can connect and make/join games. The Observer pattern seems attractive in this case, since I could host all the game model/logic on the server, and the clients would just be observers to this and dis...

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 stderr if a magic env is set). Additionally, the class has an interface for incrementally return results as well as storing them (in memory...

Good way to have a Collection Listener ?

Is there a better way to have a listener on a java collection than wrap it in a class implementing the observer pattern ? ...

Monitoring Active Directory events

How can I programatically detect any changes that occur to Microsoft's Active Directory? ...

seam shutdown listener

Hi all, I would like to observe when the application is about to shutdown. I thought this code block would work, but it never catches that event. My component is an event scoped component, I only want it to live for the scope of that event. @Observer("org.jboss.seam.preDestroyContext.APPLICATION") @Transactional public void o...

Observer pattern C# using generics

I am trying to implement the observer pattern with a slight twist, the Subject and Observer are the same class. For example, class myclass { public delegate void UpdateHandler(object sender); public event UpdateHandler UpdateEvent; public Attach(myclass obj){ // use delegate to attach update function of obj} public Update(ob...

Design pattern needed

Hi, I am going to develop a tool that will do the following: collect the files from remote server - periodically every few minutes. Export the collected files into a one single file. From the client, it sends a request to the server every 5 or 10 mins. Then server then sends a list of files. This part is called 'collection'. Afte...

Why does my code result in "cannot instantiate abstract class"?

This is the line where the error occurs: this->_tbfCmdHandler.reset(new Bar()); facade_impl.cpp(202): error C2259: 'FOO::Bar' : cannot instantiate abstract class due to following members: 'void Subscriber::update(T)' : is abstract with T=char & observer.h(66) : see declaration of ...

access declaration can only be applied to a base class member

i'm using the observer pattern. I've a class that implements the publisher class: class foo : public Publisher<const RecoveryState &>, public Publisher<char &>, therin in try to bind the attach function: using Publisher<const RecoveryState &>::attach; using Publisher<const char &>::attach; the RecoveryState works, but at the...

iPhone - An instance of class ... is being deallocated while key value observing are still registered with it

Hello! I have a ViewController (with a MKMapView) which is pushed into, because of the NavigationController. So I have a NavBar with a "back" button. Clicking that back-button, I get an error: 2010-01-11 18:05:35.273 TestApp[147:207] An instance 0x1758f0 of class MKUserLocation is being deallocated while key value observers are stil...

How to register listening for Contact changes on android 2.0?

How to register a content observer to listen for changes in the contact database in android 2.0? What URI should I use? Thank you ...

iPhone - observer / every x seconds

Hello! I have an observer like this: [mapView.userLocation addObserver:self forKeyPath:@"location" options:0 context:NULL]; So a method is called if an user changes his geolocation. But I want that the method should also be called every x seconds, because If the user does not move, the location won't change and so the method won't be...

Advice/preparation for a user observation session?

What we have so far of The Product will be shown to users soon. I was one of the primary developers, and I've been invited to observe the users while they're introduced to it and use it for the first few times. I'll be sitting in the room with them. My goal is to discover through their use things I can change to make the software "bet...

How to create a client notification service for a webapp or should I use an Observer Pattern?

Hi Guys, I have a fully implemented DAO and all my beans inherit an Entity object. Now, I want to create a client notification system whereby, when a user creates/updates/delete an entity to/from a persistence storage, a notification is automatically sent to the client via email. I have a DAO manager that uses a Factory Pattern to ret...

Remote Observables in .NET

I encounter this scenario all the time, but have never found anything but home-grown solutions to it: You view a list of orders When you make changes to those orders, they dynamically update on any other clients screens who are looking at the same list, and vice versa I call this idea "Remote observables"... not sure if it has a bett...