Sorry, this entry is only available in Deutsch.
Sorry, this entry is only available in Deutsch.
Sorry, this entry is only available in Deutsch.
Sorry, this entry is only available in Deutsch.
Today I would like to present the Observer pattern from the familiy of the behavioral patterns to you. From my point of view it is one of the most important and most used patterns and should be part of the basic knowledge of every good programmer. Some of you may want to say : “Hey why do you spent time in writing this ? Java and .NET have delegates and events so you most commonly don’t have to implement observers on your own.” You are right ! But I think it is very important to understand the technology behind it and so I want to give the beginners of you a crash course.
To warm up a little, let’s do a small example:
Let’s imagine we are sitting at a controlpanel and our job is to supervise the location of some trains. That would be an enourmous work to always ask the trains for their location, wouldn’t it ? So why don’t we turn the tides ? Let the train do the job and let him notify us if his location has changed. All we have to do is to tell him that they should notify us in time. The Advantage with that is, that the train is able to notify not just you but also everyone who has told him to do so. So all of your teammates are able to get the train’s position, too.
Deutsch
Englisch

