By gauravjassal
via gauravjassal.com
Submitted: Nov 09 2009 / 15:02
The Observer pattern defines a mechanism by which components can opt-in to receive messages when a target object changes its state. Its works similar to Listening to a Change event for a object or Trigger in a database, which runs a stored procedure when a table row is modified.
Comments
jakyra replied ago:
This leaves out how to remove observers from a subject.
gauravjassal replied ago:
I didn't write any code to remove the observer. But I think it will be as simple as adding them. You can remove remove observer in detach function.
Voters For This Link (3)
Voters Against This Link (0)