Archiv der Kategorie: C#

Design patterns: Command

The Command design pattern encapsulates a request as an object. This will allow adding additional functionality to the request. A typical example is the undo/redo functionality. The command object will be used as mediator between the client and the receiver … Weiterlesen

Veröffentlicht unter .NET, C#, Design Pattern | Kommentar hinterlassen

Methods should do one thing only

According to the Single Responsibility Principle a class should have one, and only one, reason to change. To same statement is valid for methods. A method should do one thing only and therefore have only one reason to change. Unfortunately … Weiterlesen

Veröffentlicht unter .NET, C#, Clean Code | Kommentar hinterlassen

Dependency Inversion by using the Unity Injection Constructor

One of the five SOLID principles is Dependency Inversion. To implement according to this principle you can use interfaces and dependency injection. As a software application normally consists of hundreds or thousands of objects you will have to set up … Weiterlesen

Veröffentlicht unter .NET, C#, Design Pattern | Kommentar hinterlassen

Linq vs Loop: Join

Like in the previous article of this series I want to compare Linq with a classical loop. This time we want to look at data objects which shall be joined to create a result. Again we want to use validated … Weiterlesen

Veröffentlicht unter .NET, C#, LINQ | Kommentar hinterlassen

Linq vs Loop: Nested Loop

Like in the previous article of this series I want to compare Linq with a classical loop. This time we want to look at the use case to handle data which contains nested data. Again we want to use validated … Weiterlesen

Veröffentlicht unter .NET, C#, Clean Code, LINQ | Kommentar hinterlassen

Design patterns: Composite

The composite design pattern is used to compose objects into a tree structure. So each element can hold a list of sub elements. Optional it may have a link to the parent object within the tree. Within the following example … Weiterlesen

Veröffentlicht unter .NET, C#, Design Pattern | Kommentar hinterlassen

Crash course: Asynchronous Programming with async and await

With the .NET Framework 4.5 the new keywords “async” and “await” were introduced. These keywords will aloe an asynchronous programming which is nearly as easy as synchronous programming. With this article I want to give you a crash course into … Weiterlesen

Veröffentlicht unter .NET, C#, Crashkurs | Kommentar hinterlassen