Skip to content

RE: The Observer Pattern

Dave Burke has a pretty good description of how to use the Observer pattern. I’ll skip into the gory details, you find that on the link to his article. It describles how you coordinate multiple views of the same set of data in the user interface.

It’s another way to describe the subscriber/publisher model. Your data publishes events when something changes (the user views a different record, changes the ordeing, etc) and the various UI elements that subscribe to the data will get the events. Once they get that event, they can determine if action is rtequired for their view of the data.

It’s one of those things that when you see it, you think “That makes sense, why didn’t I do it that way.”