Author:
Michael Morbach
May
27
In the daily routine of a developer you often get in touch with lists and sets of similar objects and their manipulation. .NET delivers you the “Collections” to store your objects. These collections are a wide selection of objects where everyone of them can be assigned to a certain purpose. Sometimes it is also important to extend one of these collections so you can access your own custom objects in this collection. I recently had this case and I thought I could write a short article about creating custom collections.
Choosing the suitable Collection !
There is a wide selection of different listtypes. There are for example Stacks, Queues, ArrayList, Hashtable, Dictionary and a lot more. Each one of these collections got an own purpose and should be chosen wisely. For example you shouldn’t use an Arraylist to fill it with elements and process them one after another, because there is a collection named Queue for this purpose.
Read the rest of this entry »
Author:
Michael Morbach
May
27
After several months, which this blog has behind itself, I finally found a a reasonable WordPress plugin which makes it possible for me to write articles in english and german. I used the Plugin QTranslate from Qian Qin. I chose this one because of its easy installation and comfortable handling.
I already decided at the beginning of this blog to write articles in english and german to improve my english and on the other hand to speak to a wider span of readers. I actually don’t know if I find enough time to translate the previous articles to english but it’s good to know that all further articles will be multilingual.
Filed under:
General, Tools
Author:
Michael Morbach
May
25
When 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…
Author:
Michael Morbach
May
13
People 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
Author:
Michael Morbach
May
13
Nachdem ich euch beim letzten mal das Strategy Pattern vorgestellt habe, möchte ich euch heute ein weiteres sehr nützliches Pattern aus der Familie der Creational Patterns vorstellen. Das Abstract Factory Pattern. Factory passt hier vom Namen schon sehr gut, weil es tatsächlich eine Fabrik für neue Objekte ist.
Und was kann dieses Pattern ?
Stellen wir uns einmal vor, wir möchten Autos erstellen lassen. Viele verschiedene Autos verschiedener Hersteller mit verschiedenen Motoren und unterschiedlichen Reifen, welche wiederrum auch wieder Sommer- oder Winterreifen sein können. Klingt nach einer sehr komplexen Sache mit vielen Klassen. Geht aber ganz einfach !
Zunächst brauchen wir Klassen für die einzelnen Objekte unseres Autos. Dazu gehören Reifen und ein Motor. Da wir zwischen Sommer- und Winterreifen unterscheiden möchten, schreiben wir zusätzlich eine kleine ENUM. Also schreiben wir insgesamt zunächst die folgenden 4 Klassen.

Read the rest of this entry »