Archive for the ‘ Softwarearchitecture ’ Category

Sorry, this entry is only available in Deutsch.

Head First Design Patterns C# – Update

Sorry, this entry is only available in Deutsch.

The Observer Pattern

ObserverToday 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.

Read the rest of this entry »

Head First Design Patterns in C#

Head First Design PatternsWhen I began to write about Design Patterns, I recommended a Book that helped me to to learn the GoF Patterns myself. The book’s name was Head First Design Patterns. Because all of the book’s examples are written in Java, I thought that I could translate these examples for those of you who are more into C# and put the code up to my Repository.

Said and done ! Today I took the first example pattern from the first chapter of the book and translated the Strategy Pattern to C#. The example about the Strategy Pattern and a horde of ducks can be found on my Pattern SVN Repository. Maybe it is worth a look for the friends of C# out there. More C# patterns will follow…

Want some Code ?

RepositoryPeople often asked me where the, in the introducing text mentioned, SVN Repository is. Because my recent projects were frozen a little bit, I took the link to the Repository out of the list since last Blog Design Update.

But now I took some time to update and set up a new repository to publish all new Design Patterns I will write articles about here. So from now on you are invited to look into the sourcecode of all my published articles about Design Patterns and you might of course use it for further development.

Please notice the hyperlink to the design patterns repository on the linklist to the right. There you can always access the current versions of my design patterns (also to those I didn’t write articles about yet)

Again, here is the Link to the Design Patterns SVN Repository @ code.google.com