Archiv der Kategorie: Design Pattern

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

Design patterns: Strategy

The strategy design pattern is used in case different algorithms are implemented and shall vary dynamically dependent on the use case. Very often, you can implement functionality in different ways. In most use cases you look at the pros and … Weiterlesen

Veröffentlicht unter Design Pattern, Designprinzip, Uncategorized | 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

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

Design patterns: Singleton

By using the Singleton design pattern you ensure that a class has only one instance. The instance operation is provided by the class itself. So it maintains its own unique instance. The .NET framework offers a very simple and thread-safe … Weiterlesen

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

Design patterns: Proxy

The idea of the Proxy design pattern is to provide a substitute for another object were the substitute controls the access to the other project. So there is one real subject with a given interface, for example an object to … Weiterlesen

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

Design patterns: Observer

The Observer design pattern is used when you want to define a one-to-many dependency between objects. In case one object changes its state, all its dependents are notified and updated automatically. In this design pattern you have two participants. The … Weiterlesen

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

Design patterns: Adapter

The Adapter design pattern, which is also known as Wrapper design pattern, is used to convert the interface of an existing class into an interface expected by the client. In such a case the existing class has an incompatible interface. … Weiterlesen

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

Design patterns: Iterator

An Iterator provides a way to access the elements of an object sequentially without exposing the underlying representation. It is a base Design Patterns which we use permanently. For example a loop over a list is done by using the … Weiterlesen

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

Design patterns: Facade

A Façade class provides a higher level interface to a set of sub level interfaces. This will make the subsystem easier to use. The high level interface will hide details of the low level interfaces. This may be complex workflows … Weiterlesen

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