Link Details

Link 285339 thumbnail
User 298346 avatar

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.
  • 3
  • 0
  • 162
  • 30

Comments

Add your comment
User 244651 avatar

jakyra replied ago:

0 votes Vote down Vote up Reply

This leaves out how to remove observers from a subject.

User 298346 avatar

gauravjassal replied ago:

0 votes Vote down Vote up Reply

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.

Add your comment


Html tags not supported. Reply is editable for 5 minutes. Use [code lang="java|ruby|sql|css|xml"][/code] to post code snippets.

Voters For This Link (3)



Voters Against This Link (0)