Archiv des Autors: oliverfunke

Virtual functions in ctor and dtor

During construction and destruction of an object you are able to call virtual functions. But you should not do this. That’s because it is a source for errors as the behavior of the application may be differ from your expectations … Weiterlesen

Veröffentlicht unter C++ | 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

Show costs of Quick & Dirty implementations

I am sure you all know this issue: There are situations where you have to implement something in a quick & dirty manner. You know that this way of implementation is wrong. And you be afraid of or maybe know … Weiterlesen

Veröffentlicht unter Projektleitung | Kommentar hinterlassen

Delete commented-out code

You may see it the source code of nearly in every software project: commented-out code. Maybe you ignore and read over it or maybe you ask yourself: Why does this commented-out code exist? Does the creator of this code store … Weiterlesen

Veröffentlicht unter Uncategorized | Kommentar hinterlassen

Functor, Lamdba and Predicate

Within this blog article I want to explain the C++ functor, lambda and predicate concepts by using them in short and easy to understand examples.   Functor A functor is a class or struct which acts like a function. This … Weiterlesen

Veröffentlicht unter C++ | Kommentar hinterlassen

Use const whenever possible

The const keyword allows you to specify a semantic constraint: an object should not be modified. And compilers will enforce that constraint. This will allow you to communicate to the compiler and to other developers that the object should remain … Weiterlesen

Veröffentlicht unter C++ | 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